Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apiscenario #17264

Closed
wants to merge 77 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
9877dab
sync signalr test scenarios
zhenglaizhang Aug 10, 2021
73681fa
remove extra template.json
zhenglaizhang Aug 10, 2021
820529c
add asc scenarios file
sonwan2020 Aug 18, 2021
895d332
add uploadJar scripts
ruowan Aug 24, 2021
16c62f2
add uploadJar
ruowan Aug 24, 2021
931136f
add deploymentScripts
ruowan Aug 31, 2021
1ef004d
update readme
ruowan Aug 31, 2021
d322d24
update doc and use blob sas url to download
ruowan Sep 1, 2021
e0c7e76
delete unused powershell file and format scripts
ruowan Sep 2, 2021
673763b
adjust asc scenarios file
sonwan2020 Sep 5, 2021
2a533f9
update springCloud test scenario
ruowan Sep 7, 2021
3918720
update powershell scripts
ruowan Sep 7, 2021
118524a
v2 schema
leni-msft Sep 7, 2021
7175dff
fix
leni-msft Sep 7, 2021
dbaf795
prettier
leni-msft Sep 7, 2021
6e0b281
Merge branch 'sonwan/add-asc-scenarios-file' into leni/add-asc-scenar…
leni-msft Sep 7, 2021
6c46c76
securestring
leni-msft Sep 8, 2021
6755294
fix action
leni-msft Sep 8, 2021
50ce6ee
fix
leni-msft Sep 9, 2021
4999c21
Merge pull request #1 from sonwan2020/leni/add-asc-scenarios-file
sonwan2020 Sep 13, 2021
6d839ef
fit 2.9.0, waiting for verify
sonwan2020 Sep 13, 2021
3361752
fix domainName
leni-msft Sep 15, 2021
f92606d
json to yaml
leni-msft Sep 15, 2021
28d24b4
fix output variable type
leni-msft Sep 15, 2021
c65690e
remove redundent defaultValue in armTemplate
leni-msft Sep 15, 2021
079ba35
generate uniq name
leni-msft Sep 15, 2021
70e6b2f
Adapt to v1.1 schema
leni-msft Sep 16, 2021
ffedd7c
remove unnecesary file
leni-msft Sep 18, 2021
f656da0
fix patch step
leni-msft Sep 23, 2021
436edc8
update springCloud test scenario
ruowan Sep 26, 2021
284c7c5
update spring cloud yaml
ruowan Sep 27, 2021
13e7efb
prettier
leni-msft Sep 27, 2021
436154f
add overwrite variable
ruowan Sep 28, 2021
e8683b4
new schema
Nov 26, 2021
047796e
delete unused file
Nov 29, 2021
fa5943f
rename armTemplateDeployment to armTemplate
Nov 29, 2021
afe0724
webpubsub
leni-msft Dec 13, 2021
eec25d2
v1.2 schema
leni-msft Jan 6, 2022
44746b8
v1.2 schema
leni-msft Jan 6, 2022
63dc64d
webpubsub
leni-msft Jan 6, 2022
984da32
Merge commit 'refs/pull/15689/head' of github.com:Azure/azure-rest-ap…
leni-msft Jan 6, 2022
7dc1464
Merge commit 'refs/pull/15597/head' of github.com:Azure/azure-rest-ap…
leni-msft Jan 6, 2022
63e8072
v1.2 schema
leni-msft Jan 6, 2022
65b8de7
adapt asc/signalr to v1.2 schema
leni-msft Jan 6, 2022
b1b2978
more data types in v1.2 schema
leni-msft Jan 7, 2022
b4b8842
v1.2 schema
leni-msft Jan 7, 2022
38aa5b6
convert to new syntax
leni-msft Jan 7, 2022
2c649fa
restore example
leni-msft Jan 7, 2022
a101eb7
tiny change
leni-msft Jan 12, 2022
2697ad1
refine variables schema
leni-msft Jan 21, 2022
296d468
fix scenarios
Feb 18, 2022
cd071ca
fix scenarios
Feb 22, 2022
6a3b306
signalr basic crud
leni-msft Mar 11, 2022
4d7c593
Merge branch 'main' of github.com:Azure/azure-rest-api-specs into api…
leni-msft Mar 15, 2022
0590b97
cdn scenario coverage 57%
leni-msft Mar 15, 2022
b215094
add responses schema
leni-msft Mar 17, 2022
135078e
use readmeTag insteadof swagger
leni-msft Mar 21, 2022
18c1c10
fix rp
leni-msft Mar 21, 2022
9a0cef0
fix schema
leni-msft Mar 21, 2022
6801b8f
fix step scope variables
leni-msft Mar 21, 2022
aad11e7
fix step variables
leni-msft Mar 22, 2022
1965b5b
fix
leni-msft Mar 22, 2022
060295a
[ApiScenario] update doc (#18424)
tianxchen-ms Mar 28, 2022
2667c74
update docs
leni-msft Mar 29, 2022
a0309e0
fix schema
leni-msft Mar 29, 2022
f7a989b
Update variables.md
leni-msft Mar 30, 2022
cf0710e
commit scenario files
leni-msft Mar 30, 2022
8292706
Merge remote-tracking branch 'origin/main' into apiscenario
leni-msft Mar 30, 2022
e55a5cf
remove scenario files
leni-msft Mar 30, 2022
4a94eab
update schema line
leni-msft Mar 30, 2022
7ae68f1
remove resourceUpdate
leni-msft Mar 31, 2022
cbdda02
remove resourceUpdate
leni-msft Mar 31, 2022
8a60250
Revert "remove scenario files"
leni-msft Mar 31, 2022
59d9cfa
fix scenario files
leni-msft Mar 31, 2022
bbada01
fix scenario
Apr 8, 2022
44e9720
Merge branch 'main' into apiscenario
leni-msft Apr 8, 2022
eb829ed
update schema ref
leni-msft Apr 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"runtimeVersion": "Java_8"
},
"instances": null
},
"sku": {
"name": "S0",
"tier": "Standard",
"capacity": 1
}
},
"sku": {
"name": "S0",
"tier": "Standard",
"capacity": 1
},
"api-version": "2020-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "myResourceGroup",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,372 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json
scope: ResourceGroup

variables:
serviceName: test-scenario-instance
appName: app01
ascDomainName: .azuremicroservices.io
dnsCname: asc
customDomainName:
type: string
mysqlKey:
type: secureString
dnsSubscriptionId:
type: string
dnsResourceGroup:
type: string
blobUrl:
type: secureString
userAssignedIdentity:
type: string

prepareSteps:
- step: Generate_Unique_ServiceName
armTemplate: templates/generate_service_name.json

- step: Create_Application_Insight_Instance
armTemplate: templates/create_application_insights_instance.json

- step: Add_Dns_Cname_Record
armDeploymentScript: ./templates/create_cname_record.ps1
environmentVariables:
- name: resourceGroupName
value: $(dnsResourceGroup)
- name: dnsZoneName
value: $(customDomainName)
- name: dnsCname
value: $(dnsCname)
- name: dnsCnameAlias
value: $(serviceName)$(ascDomainName)
variables:
subscriptionId: $(dnsSubscriptionId)
resourceGroupName: $(dnsResourceGroup)

scenarios:
- scenario: Spring
description: Microsoft.AppPlatform/Spring
steps:
- step: Services_CheckNameAvailability
exampleFile: ../examples/Services_CheckNameAvailability.json
requestUpdate:
- replace: /availabilityParameters/name
value: $(serviceName)

# Services
- step: Services_CreateOrUpdate
exampleFile: ../examples/Services_CreateOrUpdate.json

- step: Services_Get
exampleFile: ../examples/Services_Get.json

- step: Services_Update
exampleFile: ../examples/Services_Update.json
requestUpdate:
- replace: /resource/tags
value:
hello: world
created-by: api-test

- step: Services_DisableTestEndpoint
exampleFile: ../examples/Services_DisableTestEndpoint.json

- step: Services_EnableTestEndpoint
exampleFile: ../examples/Services_EnableTestEndpoint.json

- step: Services_RegenerateTestKey
exampleFile: ../examples/Services_RegenerateTestKey.json

- step: Services_ListTestKeys
exampleFile: ../examples/Services_ListTestKeys.json

- step: Certificates_CreateOrUpdate
exampleFile: ../examples/Certificates_CreateOrUpdate.json
variables:
certificateName: asc-certificate
requestUpdate:
- replace: /certificateResource/properties
value:
vaultUri: https://integration-test-prod.vault.azure.net/
keyVaultCertName: pfx-cert

- step: Certificates_Get
exampleFile: ../examples/Certificates_Get.json
variables:
certificateName: asc-certificate

- step: Certificates_List
exampleFile: ../examples/Certificates_List.json

# ConfigServers
- step: ConfigServers_Validate
exampleFile: ../examples/ConfigServers_Validate.json
requestUpdate:
- replace: /configServerSettings/gitProperty
value:
uri: https://github.com/VSChina/asc-config-server-test-public.git
label: master
searchPaths: ["/"]

- step: ConfigServers_UpdatePut
exampleFile: ../examples/ConfigServers_UpdatePut.json
requestUpdate:
- replace: /configServerResource/properties/configServer/gitProperty
value:
uri: https://github.com/VSChina/asc-config-server-test-public.git
label: master
searchPaths: ["/"]

- step: ConfigServers_UpdatePatch
exampleFile: ../examples/ConfigServers_UpdatePatch.json
requestUpdate:
- replace: /configServerResource/properties/configServer/gitProperty
value:
uri: https://github.com/azure-samples/spring-petclinic-microservices-config

- step: ConfigServers_Get
exampleFile: ../examples/ConfigServers_Get.json

# Monitoring
- step: MonitoringSettings_UpdatePut
exampleFile: ../examples/MonitoringSettings_UpdatePut.json
requestUpdate:
- replace: /monitoringSettingResource/properties
value:
traceEnabled: true
appInsightsInstrumentationKey: "$(insightsInstrumentationKey)"
appInsightsSamplingRate: 50.0

- step: MonitoringSettings_Get
exampleFile: ../examples/MonitoringSettings_Get.json

- step: MonitoringSettings_UpdatePatch
exampleFile: ../examples/MonitoringSettings_UpdatePatch.json
requestUpdate:
- replace: /monitoringSettingResource/properties/appInsightsSamplingRate
value: 100

# Apps
- step: Apps_Create
exampleFile: ../examples/Apps_CreateOrUpdate.json
requestUpdate:
- remove: /appResource/properties/temporaryDisk
- remove: /appResource/properties/persistentDisk
- replace: /appResource/properties/public
value: false

- step: Apps_Get
exampleFile: ../examples/Apps_Get.json

- step: Deployments_CreateOrUpdate_Default
exampleFile: ../examples/Deployments_CreateOrUpdate.json
variables:
deploymentName: default
requestUpdate:
- replace: /deploymentResource/properties/source/type
value: Jar
- replace: /deploymentResource/properties/source/relativePath
value: "<default>"

- step: Deployments_Get
exampleFile: ../examples/Deployments_Get.json
variables:
deploymentName: default

- step: Apps_Update_ActiveDeployment # PATCH
exampleFile: ../examples/Apps_Update.json
requestUpdate:
- replace: /appResource/properties/activeDeploymentName
value: default

- step: Apps_Update_Disk # PATCH
exampleFile: ../examples/Apps_Update.json
requestUpdate:
- replace: /appResource/properties/temporaryDisk
value: { "sizeInGB": 3, "mountPath": "/tmpdisk" }
- replace: /appResource/properties/persistentDisk
value: { "sizeInGB": 10, "mountPath": "/data" }
- replace: /appResource/properties/public
value: true

- step: Apps_List
exampleFile: ../examples/Apps_List.json

# # Bindings
- step: Bindings_Create
exampleFile: ../examples/Bindings_CreateOrUpdate.json
variables:
bindingName: mysql-binding
requestUpdate:
- replace: /bindingResource/properties/resourceId
value: "/subscriptions/b46590cb-a111-4b84-935f-c305aaf1f424/resourceGroups/mary-west/providers/Microsoft.DBforMySQL/servers/fake-sql"
- replace: /bindingResource/properties/key
value: $(mysqlKey)
- replace: /bindingResource/properties/bindingParameters
value: { "databaseName": "mysqldb", "username": "test" }

- step: Bindings_Update # PATCH
exampleFile: ../examples/Bindings_Update.json
variables:
bindingName: mysql-binding
requestUpdate:
- replace: /bindingResource/properties/key
value: $(mysqlKey)
- replace: /bindingResource/properties/bindingParameters
value: { "databaseName": "mysqldb2", "username": "test2" }

- step: Bindings_Get
exampleFile: ../examples/Bindings_Get.json
variables:
bindingName: mysql-binding

- step: Bindings_List
exampleFile: ../examples/Bindings_List.json

- step: Bindings_Delete
exampleFile: ../examples/Bindings_Delete.json
variables:
bindingName: mysql-binding

# CustomDomains # depends on DNS
- step: Apps_ValidateDomain
exampleFile: ../examples/Apps_ValidateDomain.json
requestUpdate:
- replace: /validatePayload/name
value: $(customDomainName)

- step: CustomDomains_CreateOrUpdate
exampleFile: ../examples/CustomDomains_CreateOrUpdate.json
variables:
domainName: $(dnsCname).$(customDomainName)
requestUpdate:
- replace: /domainResource/properties
value: { "certName": "asc-certificate" }

- step: CustomDomains_Update
exampleFile: ../examples/CustomDomains_Update.json
variables:
domainName: $(dnsCname).$(customDomainName)
requestUpdate:
- replace: /domainResource/properties
value: { "certName": "asc-certificate" } # TODO: use another cert

- step: CustomDomains_Get
exampleFile: ../examples/CustomDomains_Get.json
variables:
domainName: $(dnsCname).$(customDomainName)

- step: CustomDomains_List
exampleFile: ../examples/CustomDomains_List.json

# Deployments
- step: Apps_GetResourceUploadUrl
exampleFile: ../examples/Apps_GetResourceUploadUrl.json
outputVariables:
uploadUrl:
type: secureString
fromResponse: /uploadUrl
relativePath:
fromResponse: /relativePath

- step: Upload_File
armDeploymentScript: ./templates/uploadJar.ps1
environmentVariables:
- name: uploadUrl
value: $(uploadUrl)
- name: blobUrl
value: $(blobUrl)

- step: Deployments_CreateOrUpdate
exampleFile: ../examples/Deployments_CreateOrUpdate.json
variables:
deploymentName: blue
requestUpdate:
- replace: /deploymentResource/sku/capacity
value: 2
- replace: /deploymentResource/properties/source/type
value: Jar
- replace: /deploymentResource/properties/source/relativePath
value: $(relativePath)

- step: Apps_Update # PATCH
exampleFile: ../examples/Apps_Update.json
requestUpdate:
- replace: /appResource/properties/activeDeploymentName
value: blue

- step: Deployments_Restart
exampleFile: ../examples/Deployments_Restart.json
variables:
deploymentName: blue

- step: Deployments_Stop
exampleFile: ../examples/Deployments_Stop.json
variables:
deploymentName: blue

- step: Deployments_Start
exampleFile: ../examples/Deployments_Start.json
variables:
deploymentName: blue

- step: Deployments_GetLogFileUrl
exampleFile: ../examples/Deployments_GetLogFileUrl.json
variables:
deploymentName: blue

- step: Deployments_List
exampleFile: ../examples/Deployments_List.json

- step: Deployments_ListForCluster
exampleFile: ../examples/Deployments_ListForCluster.json

- step: Services_List
exampleFile: ../examples/Services_List.json

- step: Services_ListBySubscription
exampleFile: ../examples/Services_ListBySubscription.json

- step: Deployments_Delete
exampleFile: ../examples/Deployments_Delete.json
variables:
deploymentName: blue

- step: CustomDomains_Delete
exampleFile: ../examples/CustomDomains_Delete.json
variables:
domainName: $(dnsCname).$(customDomainName)

- step: Apps_Delete
variables:
appName: app01
exampleFile: ../examples/Apps_Delete.json

- step: Certificates_Delete
exampleFile: ../examples/Certificates_Delete.json
variables:
certificateName: asc-certificate

- step: Services_Delete
exampleFile: ../examples/Services_Delete.json

- step: Skus_List
exampleFile: ../examples/Skus_List.json

# - step: RuntimeVersions_ListRuntimeVersions # ASC team bug
# exampleFile: ../examples/RuntimeVersions_ListRuntimeVersions.json

- step: Operations_List
exampleFile: ../examples/Operations_List.json

cleanUpSteps:
- step: delete_cname_record
armDeploymentScript: ./templates/delete_cname_record.ps1
environmentVariables:
- name: resourceGroupName
value: $(dnsResourceGroup)
- name: dnsCname
value: $(dnsCname)
- name: dnsZoneName
value: $(customDomainName)
variables:
subscriptionId: $(dnsSubscriptionId)
resourceGroupName: $(dnsResourceGroup)
Loading