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

Developer/patojaro/customhostnamesites optional param #18620

Closed
wants to merge 75 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
1bcc20d
Add blockchain to latest profile
markcowl Aug 22, 2019
7b46097
Add additional types
markcowl Aug 22, 2019
e856777
Merge branch 'Azure:main' into main
ElleTojaroon Feb 5, 2022
22a1eeb
add optional hostname param to customHostnameSites RT and add examples
Feb 5, 2022
cef712e
fix random sub in examples
Feb 5, 2022
f1b7478
fix OBJECT_ADDITIONAL_PROPERTIES
Feb 8, 2022
fc226f7
prettier
Feb 8, 2022
cc98f32
fix DUPLICATE_PARAMETER
Feb 8, 2022
50d804b
Set cache patching default time as 5 hours (#18430)
koderjoker Mar 30, 2022
fdfdd76
fix: wrong integrationRepo settings (#18446)
tadelesh Mar 30, 2022
4122f37
dev-Sentinel-2022-04-01-preview (#18410)
anat-gilenson Mar 30, 2022
98c3474
Change description (#18455)
ruslany Mar 30, 2022
944f800
Databoxedge march release (#18374)
amishra31 Mar 30, 2022
e43e772
Adding properties to DC patch (#18456)
jorgbaca Mar 30, 2022
83f6c7b
Update readme.go.md (#18065)
LarryZhang19 Mar 30, 2022
2a93926
add xms-ids for msi (#17880)
LinglingTong Mar 30, 2022
960e99d
Use enum for FHIR resource type (#18483)
ms-teli Mar 30, 2022
3092f2a
Update per privacy feedback (#18486)
lucia-msft Mar 30, 2022
e8b3800
[KeyVault] - Suppress known validation false-positives (#18370)
maorleger Mar 30, 2022
927e500
Update with Privacy feedback (#18485)
lucia-msft Mar 30, 2022
f4d936a
[Hub Generated] Review request for Microsoft.DataFactory to add versi…
Khalil-Ammar Mar 31, 2022
e9738dd
set default tag for resource-manager to resources (#18475)
cataggar Mar 31, 2022
a0c83df
add xms-ids for mixedreality (#17824)
LinglingTong Mar 31, 2022
b6a7845
[Go] Add batch tag 03/31/2022 (#18491)
Alancere Mar 31, 2022
aeb8c9f
Use the common-types for ApiVersionParameter (#18494)
Mar 31, 2022
3b2098c
Prefix data model with domain name explicitly. (#18505)
ms-teli Apr 1, 2022
95a128e
2020-10-01 GA release of PIM specs (#18459)
amanswaika Apr 1, 2022
850d75f
KubernetesConfiguration 2022-04-02-preview version changes (#18138)
RamyasreeChakka Apr 1, 2022
8598593
Swagger changes for new Predict API in Advisor RP (#18168)
pedrobragioni Apr 1, 2022
1fc0e9e
update v5 for ipv6-2021-11-01 (#18490)
LeiWang3 Apr 1, 2022
d55f30f
[Microsoft.Resources] Added missing error property to deployment prop…
jorgecotillo Apr 1, 2022
b9f7b5b
{azure-rest-api-specs} Add possible values for DomainValidationMethod…
RakeshMohanMSFT Apr 1, 2022
48d8558
update readme.python.md (#18515)
kazrael2119 Apr 1, 2022
a1a224b
Add AutoGeneratedDomainNameLabelScope (#18522)
qingquanzhao Apr 2, 2022
49f003b
Adding new API version "2022-03-01" from "2021-12-01-preview" (#18260)
mayankagg9722 Apr 4, 2022
eda5eda
add xms-ids for PowerBIPrivateLinks (#17973)
LinglingTong Apr 5, 2022
f95a6b0
Add xms-ids for PolicyInsights (#17965)
LinglingTong Apr 5, 2022
e0d4c13
add xms-ids for PowerBIEmbedded (#17972)
LinglingTong Apr 5, 2022
66ce6ad
New API Version 2022-02-01 for Azure Site Recovery (#18325)
singhabh27 Apr 5, 2022
bb2f9b0
2022-02-01 API Version changes for recoveryservicesbackup (#18326)
singhabh27 Apr 5, 2022
b9b3dc9
[Hub Generated] Add new API version from 'yinshen/autoadd' (#17305)
shenyingjun Apr 5, 2022
071bf83
Changing AD structure so the secret can be created properly (#18507)
sureleo Apr 5, 2022
12aa4dd
[Hub Generated] Review request for Microsoft.AzureStackHCI to add ver…
sugatt Apr 5, 2022
cc3e90b
Update specificationRepositoryConfiguration.json (#18524)
msyyc Apr 6, 2022
ad39d6d
update example files (#18418) (#18510)
yunheMsft Apr 6, 2022
6f8dd05
[Hub Generated] Review request for Microsoft.RecoveryServices to add …
singhabh27 Apr 6, 2022
896960a
Add List Secrets for Dapr Components (#18436)
vusause Apr 6, 2022
ba759da
removing unused property from ArcData\SqlServerInstance resource type…
Shiwani-K Apr 6, 2022
2cf0d86
Updated MFE property descriptions to indicate if the property is requ…
erjms Apr 6, 2022
2e665b0
AVS PublicCloud availability is immutable (#18453)
cataggar Apr 6, 2022
c14d693
[cpim]update readme.python.md (#18562)
kazrael2119 Apr 6, 2022
4ed2eef
Update swagger for Custom Speech v2.0 and v3.0 (GA) (#18151)
bexxx Apr 6, 2022
f9afeda
Small fixes to swagger in Microsoft.Sql AdvancedThreatProtectionSetti…
cohen-uriel-ms Apr 6, 2022
e3cf6a0
Added x-ms-identifier for s360 linting issue (#18566)
v-sadafm Apr 6, 2022
8ee804c
update Synaspe link connection input file to tag (#18421)
yanjungao718 Apr 6, 2022
ca0335b
Merge Cognitive Services - Language version 2022-03-01-preview to mai…
heaths Apr 6, 2022
f8811b7
Update HealthcareApis.json (#18586)
JoshLove-msft Apr 6, 2022
ddd01d5
Adding response code to dataControllers PATCH. (#18556)
jorgbaca Apr 7, 2022
0b19f7f
add-typescript.md-for-cpim (#18569)
colawwj Apr 7, 2022
2668e35
[OperationalInsights] Rename 'eTag' property to 'etag' (#18447)
dabenhamMic Apr 7, 2022
028cb20
add xms-ids for netapp (#17896)
LinglingTong Apr 7, 2022
eecf176
[BotService] Add OutlookChannel to channelNames (#18149)
luhan2017 Apr 7, 2022
d045209
[Go]Add batch tag 04/07/22 (#18589)
Alancere Apr 7, 2022
e7d2d8c
Add multidimensional Root Cause Analysis APIs in Anomaly Detector Ser…
suxi-ms Apr 7, 2022
18a8f9d
Dev kubernetesconfiguration microsoft.kubernetes configuration 2022 0…
deeksha345 Apr 8, 2022
24c1d13
Update example grafanaVersion and endpoint (#18610)
qingquanzhao Apr 8, 2022
7b32d29
Add new Provisioning state for reservations (#18464)
ashokchhilar Apr 8, 2022
757ee75
[Hub Generated] Publish private branch 'appplatform/release/s202' (#1…
Caoxuyang Apr 8, 2022
34a34e0
New Api-Version onboarding 2021-12-01-preview (#18478)
Hardell Apr 8, 2022
043ce39
S360 linting issue removed enum from ApiVersionParameter (#18596)
v-sadafm Apr 8, 2022
14007e9
apiscenario doc (#18476)
leni-msft Apr 8, 2022
daac098
[operaioninsights][python]Update readme.md (#18615)
msyyc Apr 8, 2022
b52f900
change automation bot to azure-sdk (#18513)
dw511214992 Apr 8, 2022
1f034c9
add API version 2022-05-01 (#18614)
qianwens Apr 8, 2022
9679e53
Merge branch 'Azure:main' into developer/patojaro/customhostnamesites…
ElleTojaroon Apr 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,7 @@ polyline
poolusagemetrics
popreceipt
portalsettings
portalconfigs
postbackup
Postgre
Postgres
Expand Down Expand Up @@ -2262,6 +2263,7 @@ vaultusages
vcenter
Vcore
Vcores
VCPU
vcsa
versionid
Vertica
Expand Down Expand Up @@ -2491,6 +2493,8 @@ xvalue
yvalue
servermetrics
IAASVM
Picometer
Petabit
questionanswering
napt
Napt
Expand All @@ -2512,4 +2516,4 @@ IAASVM
Quickbase
Smartsheet
Qualys
servermetrics
servermetrics
2 changes: 1 addition & 1 deletion documentation/api-scenario/how-to/QuickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Now write your basic API scenario. For more detail about API scenario file forma
[API Scenario Definition Reference](../references/ApiScenarioDefinition.md).

```yaml
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.1/schema.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json

scope: ResourceGroup
scenarios:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ We use `oav` tools to generate basic API scenario. `oav` analyze swagger file an

`oav` support rule based API scenario file generation. We use this command to generate API scenario file.

`oav generate-static-api-scenario --readme <readme> --tag <tag> --rules <generated-rules>`
`oav generate-api-scenario static --readme <readme> --tag <tag> --specs <specs> --rules <generated-rules>`

OR

`oav generate-api-scenario static --readme <readme> --tag <tag> --specs <specs> --dependency <dependency-path>`

- readme: swagger readme file.
- tag: which tag to generate. oav will analyze swagger file under the tag and generate API scenario.
- specs: one or more spec file paths. type: array.
- dependency: The file path of the RESTler dependency. It cannot be used with `rules`.
- rules: Currently support two types. `resource-put-delete`, `operations-list`. Default: `resource-put-delete`
- `resource-put-delete`: generate resource put and delete API scenario.
- `operations-list`: generate operations list API scenario. `operations-list` is the simplest API which must be defined in swagger.
Expand Down
4 changes: 2 additions & 2 deletions documentation/api-scenario/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ _**Caution**: This project is in early preview phase, hence breaking changes sho

## Features

- Simple to use: Intuitive step definition based on Swagger examples and raw REST call.
- Simple to use: Intuitive step definition based on Swagger operations and examples.
- ARM Template integration: Support creating external Azure resources with ARM Template and executing Azure Powershell or Azure CLI scripts with ARM Template deployment script.
- Implementation independent: [oav](https://github.com/Azure/oav) is the default API scenario runner, and more runners will be supported, like SDKs in different languages.
- Implementation independent: [oav](https://github.com/Azure/oav) is the default API scenario runner. More runners will be supported, like SDKs in different languages.

### Demo gif

Expand Down
160 changes: 84 additions & 76 deletions documentation/api-scenario/references/ApiScenarioDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## API Scenario Definition File

See [API Scenario Definition File Schema](./v1.1/schema.json#L1)
See [API Scenario Definition File Schema](./v1.2/schema.json#L1)

File should be in format of yaml.

Expand All @@ -19,9 +19,7 @@ scenarios:
- description: test_network_public_ip
steps:
- step: Create_publicIPAddresses_pubipdns
resourceName: publicIPAddresses_pubipdns
exampleFile: ../examples/Create_publicIPAddresses_pubipdns_Generated.json
operationId: PublicIPAddresses_CreateOrUpdate
variables:
publicIpAddressName: pubipdns
```
Expand All @@ -30,27 +28,30 @@ scenarios:

- **scope**
- **Type:** Required, Enum
- **Enum:** ResourceGroup
- **Enum:** ResourceGroup, Subscription, Tenant
- Now only "ResourceGroup" is supported.
- **ResourceGroup:** All of the following API scenario and steps should be under some resourceGroup. It means:
- The consumer (API scenario runner or anything consumes API scenario) SHOULD maintain the resource group itself. Usually it requires user to input the subscriptionId/location, then it creates the resource group before test running, and deletes the resource group after running
- The consumer SHOULD set the following variables:
- **subscriptionId**
- **resourceGroupName**
- **location**
- For details of how variables works please see [Variables](./Variables.md)
- For details of how variables work please see [Variables](./Variables.md)
- **variables**
- **Type:** Optional, Map of strings
- **Type:** Optional, Map of strings or variable containers
- See [Variables](./Variables.md)
- **prepareSteps**
- **Type:** Optional, Array of [Step](#step)
- Steps that should run before every API scenario steps.
- **scenarios**
- **Type:** Required, Array of [Scenario](#scenario)
- **cleanUpSteps**
- **Type:** Optional, Array of [Step](#step)
- Steps that should run after every API scenario steps.

## Scenario

See [Scenario Schema](./v1.1/schema.json#L83).
See [Scenario Schema](./v1.2/schema.json#L249).

It defines one API scenario that could go through on its own.

Expand All @@ -61,7 +62,6 @@ description: test_network_public_ip
shareScope: true
steps:
- step: Create_publicIPAddresses_pubipdns
resourceName: publicIPAddresses_pubipdns
exampleFile: ../examples/Create_publicIPAddresses_pubipdns_Generated.json
operationId: PublicIPAddresses_CreateOrUpdate
variables:
Expand All @@ -76,10 +76,10 @@ variables:
- **shareScope**
- **Type:** Optional, Boolean or String
- **Default:** true
- Describe how the scope (ResourceGroup if scope is ResourceGroup) could be shared with other tests. If it's true or it's the same string setting for different API scenario, then they share the same scope, which means:
- These tests will run under the same scope (e.g. ResourceGroup). They may launch in parallel.
- **prepareSteps** will only run once in the scope. The variables will be shared.
- By default all the API scenario in one definition file will be launched in the same scope. If shareScope is false then it will not share anything with other API scenarios in the same file.
- Describe how the scope (ResourceGroup if scope is ResourceGroup) could be shared with other scenarios. If true or the same string value for different API scenario, they share the same scope, which means:
- These API scenarios will run under the same scope (e.g. ResourceGroup).
- **prepareSteps** and **cleanUpSteps** will run only once in the scope. The variables will be shared.
- By default all the API scenario in one definition file will be launched in the same scope. If shareScope is false, the API scenarios will not share anything with others in the same file.
- **variables**
- **Type:** Optional, Map of strings
- See [Variables](./Variables.md)
Expand All @@ -89,30 +89,33 @@ variables:

## Step

See [Step Schema](./v1.1/schema.json#L114).
See [Step Schema](./v1.2/schema.json#L280).

Defines one step in API scenario.

Should be one of the following:

- [Step REST Call](#step-rest-call)
- [REST Call](#rest-call)
- [REST Call by ResourceName Tracking and Update](#rest-call-by-resourcename-tracking-and-update)
- [REST Operation](#rest-operation)
- [REST Example](#rest-example)
- [Step ARM Template](#step-arm-template)
- [Step ARM Deployment Script](#step-arm-deployment-script)

All of the above definitions share the following fields:

- **variables**
- **Type:** Optional, Map of Strings
- See [Variables](./Variables.md)
- **step**
- **Type:** Required, String
- Step name. Must be unique in the same file.
- **description**
- **Type:** Optional, String
- A brief explanation about the step
- **variables**
- **Type:** Optional, Map of Strings or variables
- See [Variables](./Variables.md)

## Step ARM Template

See [Step ARM Template Schema](./v1.1/schema.json#L250).
See [Step ARM Template Schema](./v1.2/schema.json#L427).

Step to deploy ARM template to the scope. Template parameters and outputs will also interact with variables automatically, see [Variables](./Variables.md).

Expand All @@ -129,10 +132,9 @@ Step to deploy ARM template to the scope. Template parameters and outputs will a
- **Type:** Required, String
- Path to ARM template json file. See [ARM Template](https://docs.microsoft.com/azure/templates/).


## Step ARM Deployment Script

See [Step ARM Deployment Script Schema](./v1.1/schema.json#L266).
See [Step ARM Deployment Script Schema](./v1.2/schema.json#L448).

Step to deploy ARM deployment script to the scope. Template parameters and outputs will also interact with variables automatically, see [Variables](./Variables.md).

Expand Down Expand Up @@ -186,98 +188,104 @@ Step to deploy ARM deployment script to the scope. Template parameters and outpu

## Step REST Call

See [Step REST Call Schema](./v1.1/schema.json#L208)
Step to run a rest call defined in swagger operation. This may not be just one http call.

Step to run a swagger operation defined rest call. This may not be just one http call.

- If the operation is a long running operation (LRO), then follow the LRO polling strategy.
- If the operation is a long running operation (LRO), then follow the LRO polling strategy:
- Response statusCode must be 200 if the LRO succeeded, no matter what code the initial response is.
- If the LRO is PUT/PATCH, the runner should automatically insert a GET after the polling to verify the resource update result.
- If the operation is DELETE, then after the operation, the runner should automatically insert a GET to verify resource cannot be found.

Rest call step could be defined either by an example file, or by resourceName tracking and update.
REST call step could be defined either by an operation, or by an example file. REST call will have computed **requestParameter** and **responseExpected** after parsing and loading.

### REST Operation

See [Step Operation Schema](./v1.2/schema.json#L339)

Rest call will have computed **requestParameter** and **responseExpected** after parsing and loading:
**Example:**
```yml
- step: createPublicIPAddress
operationId: PublicIPAddresses_CreateOrUpdate
```

**Fields:**

- **operationId:**
- **Type:** Required, String
- OperationId defined in Swagger.
- **parameters:**
- **Type:** Optional, Map from parameter name to parameter value
- **responses:**
- **Type:** Optional, Map from expected response code to response headers and body.
- **outputVariables**
- **Type:** Optional, Map from variable name to object with property:
- **type**: Required, String
- **fromRequest**
- **Type:** Required, String
- Path to the request field to be used as variable.
- **fromResponse**
- **Type:** Required, String
- Path to the response field to be used as variable.

- **requestParameter**
### REST Example

### REST Call
See [Step Example Schema](./v1.2/schema.json#L389)

**Example:**

```yaml
- step: Create_publicIPAddresses_pubipdns
resourceName: publicIPAddresses_pubipdns
exampleFile: ../examples/Create_publicIPAddresses_pubipdns_Generated.json
operationId: PublicIPAddresses_CreateOrUpdate
statusCode: 200
```

**Fields:**

- **exampleFile**
- **Type:** Optional, String
- **Type:** Required, String
- Path to example file. Should be in format of "x-ms-example" files.
- **operationId**
- **Type:** Optional, String
- OperationId defined in swagger operation. It could be skipped if the example file is referenced by only one operation so we could detect the operationId.
- **statusCode:**
- **Type:** Optional, Number
- **Default:** 200
- Expected response code.
- For LRO it must be 200 to indicate succeeded result, and must be 400 to indicate failed result.
- **requestUpdate**
- **Type:** Optional, Array of [JsonPatchOp](#jsonpatchop)
- Updates that applied to the requestParameters before sending it.
- Updates that apply to the **requestParameters** before sending it, with `/parameters` in example as root of Json path.
- **responseUpdate**
- **Type:** Optional, Array of [JsonPatchOp](#jsonpatchop)
- Updates that applied to the responseExpected.
- Updates that apply to the **responseExpected**, with `/responses` in example as root of Json path.
- **outputVariables**
- **Type:** Optional, Map from variable name to object with property:
- **type**: Required, String
- **fromRequest**
- **Type:** Required, String
- Path to the request field to be used as variable.
- **fromResponse**
- **Type:** Required, String
- Path to the response field to be used as variable.

### Rest Call by ResourceName Tracking and Update
**Conventions:**

**Example**
When the scope is `ResourceGroup` and the request is a PUT/PATCH, the **requestUpdate** JsonPatchOp items starting with body parameter name SHOULD be applied to the response body (if any) for all successful status codes, excluding writeOnly properties - `x-ms-secret: true` or `x-ms-mutability` doesn't contain `read`.

```yaml
- step: Create_publicIPAddresses_pubipdns
resourceName: publicIPAddresses_pubipdns
exampleFile: ../examples/Create_publicIPAddresses_pubipdns_Generated.json
operationId: PublicIPAddresses_CreateOrUpdate
statusCode: 200
The **responseUpdate** SHOULD be applied after the **requestUpdate**, providing option to override the behavior by convention.

- step: Update_publicIPAddresses
resourceName: publicIPAddresses_pubipdns
resourceUpdate:
- replace: /properties/location
value: westus
```

Different steps with the same resourceName will be tracked by the API scenario. It knows that you are trying to update the same resource. You can use the first request with example to specify the request and resource id, then the following step with the same resourceName will use the same resource id to update the resource. For the

**Fields:**
The behavior of applying **requestUpdate** to the response body should follow JSON merge-patch ([RFC 7396](https://tools.ietf.org/html/rfc7396)).

- **resourceName**
- **Type:** Required, String
- The user-defined resource name of the resource to be tracked. It's only used as a name of that resource and do not need to be same as the actual resource name.
- **resourceUpdate**
- **Type:** Optional, Array of [JsonPatchOp](#jsonpatchop)
- Array of changes to be applied to the resource.

resourceUpdate will help to automate compute the request body and the expected response body. The algorithm will be:

- Get the expected response body from previous step with same `resourceName`, or from current step with example loaded.
- For each change in `resourceUpdate`, apply the change to the expected response body, mark as `computedAllProperties`.
- Let new request body parameter value to be: `computedAllProperties` without `readOnly` fields and `x-ms-mutability` fields that don't contains `update`.
- Let new response expected to be: `computedAllProperties` without `x-ms-secrets` fields and `x-ms-mutability` fields that don't contain `read`.
- Let the operationId to be: resource PUT operationId.
The whole process is illustrated as below pseudo-code:
```
if (scope is 'ResourceGroup' && operation.verb in ('PUT', 'PATCH')) {
updatedRequestBody = apply_JsonPatchOp(initialRequestBody, requestUpdate.body);
mergePatch = generate_JsonMergePatch(initialRequestBody, updatedRequestBody);
for (each successful status code) {
if (response.body is not empty) {
updatedResponseBody = apply_JsonMergePatch(initialResponseBody, mergePatch);
updatedResponseBody = exclude_WriteOnly_Properties(updatedResponseBody);
updatedResponseBody = apply_JsonPatchOp(updatedResponseBody, responseUpdate.body);
}
}
}
```

### JsonPatchOp

JsonPatchOp is used to define the update operation on json. You could add, remove, replace, move, copy and merge on json path.
See [Json Patch Operation Schema](./v1.2/schema.json#L490)

JsonPatchOp is used to define the update operation on json. You could add, remove, replace, copy, move, and test on json path.
All the json path used in JsonPatchOp is in format of [JsonPointer](https://datatracker.ietf.org/doc/html/rfc6901).

- [JsonPatchOp](#jsonpatchop)
Expand Down
Loading