Skip to content

Commit

Permalink
[2020-06-01-preview] Update namedvalue contract for keyvault (#10604)
Browse files Browse the repository at this point in the history
* update namedvalue contract for keyvault

* add examples

* separate out create contract

* common create contract

* fix examples
  • Loading branch information
solankisamir authored Oct 2, 2020
1 parent 21bdb07 commit 977e3b8
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@
"x-ms-examples": {
"ApiManagementGetNamedValue": {
"$ref": "./examples/ApiManagementGetNamedValue.json"
},
"ApiManagementGetNamedValueWithKeyVault": {
"$ref": "./examples/ApiManagementGetNamedValueWithKeyVault.json"
}
},
"parameters": [
Expand Down Expand Up @@ -201,6 +204,9 @@
"x-ms-examples": {
"ApiManagementCreateNamedValue": {
"$ref": "./examples/ApiManagementCreateNamedValue.json"
},
"ApiManagementCreateNamedValueWithKeyVault": {
"$ref": "./examples/ApiManagementCreateNamedValueWithKeyVault.json"
}
},
"parameters": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2677,6 +2677,51 @@
],
"description": "Issue contract Update Properties."
},
"KeyVaultContractCreateProperties": {
"properties": {
"secretIdentifier": {
"type": "string",
"description": "Key vault secret identifier for fetching secret."
},
"identityClientId": {
"type": "string",
"description": "SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to access key vault secret."
}
},
"description": "Create keyVault contract details."
},
"KeyVaultContractProperties": {
"properties": {
"lastStatus": {
"$ref": "#/definitions/KeyVaultLastAccessStatusContractProperties",
"description": "Last time sync and refresh status of secret from key vault."
}
},
"allOf": [
{
"$ref": "#/definitions/KeyVaultContractCreateProperties"
}
],
"description": "KeyVault contract details."
},
"KeyVaultLastAccessStatusContractProperties": {
"properties": {
"code": {
"type": "string",
"description": "Last status code for sync and refresh of secret from key vault."
},
"message": {
"type": "string",
"description": "Details of the error else empty."
},
"timeStampUtc": {
"type": "string",
"format": "date-time",
"description": "Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n"
}
},
"description": "Issue contract Update Properties."
},
"LoggerCollection": {
"properties": {
"value": {
Expand Down Expand Up @@ -3709,8 +3754,11 @@
"value": {
"type": "string",
"description": "Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.",
"minLength": 1,
"maxLength": 4096
},
"keyVault": {
"$ref": "#/definitions/KeyVaultContractCreateProperties",
"description": "KeyVault location details of the namedValue."
}
},
"allOf": [
Expand All @@ -3719,8 +3767,7 @@
}
],
"required": [
"displayName",
"value"
"displayName"
],
"description": "NamedValue Contract properties."
},
Expand Down Expand Up @@ -3751,8 +3798,11 @@
"value": {
"type": "string",
"description": "Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.",
"minLength": 1,
"maxLength": 4096
},
"keyVault": {
"$ref": "#/definitions/KeyVaultContractProperties",
"description": "KeyVault location details of the namedValue."
}
},
"allOf": [
Expand Down Expand Up @@ -3796,6 +3846,10 @@
"description": "Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace.",
"minLength": 1,
"maxLength": 4096
},
"keyVault": {
"$ref": "#/definitions/KeyVaultContractCreateProperties",
"description": "KeyVault location details of the namedValue."
}
},
"allOf": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"parameters": {
"serviceName": "apimService1",
"resourceGroupName": "rg1",
"api-version": "2020-06-01-preview",
"subscriptionId": "subid",
"namedValueId": "testprop6",
"parameters": {
"properties": {
"displayName": "prop6namekv",
"keyVault": {
"identityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0",
"secretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert"
},
"tags": [
"foo",
"bar"
],
"secret": false
}
}
},
"responses": {
"202": {
"headers": {
"location": "https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6?api-version=2020-06-01-preview&asyncId=5c730e343244df1b9cb56e85&asyncCode=201"
}
},
"201": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6",
"type": "Microsoft.ApiManagement/service/namedValues",
"name": "testprop6",
"properties": {
"displayName": "prop6namekv",
"keyVault": {
"secretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert",
"identityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0",
"lastStatus": {
"code": "Success",
"timeStampUtc": "2020-09-11T00:54:31.8024882Z"
}
},
"tags": [
"foo",
"bar"
],
"secret": true
}
}
},
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6",
"type": "Microsoft.ApiManagement/service/namedValues",
"name": "testprop6",
"properties": {
"displayName": "prop6namekv",
"keyVault": {
"secretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert",
"identityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0",
"lastStatus": {
"code": "Success",
"timeStampUtc": "2020-09-11T00:54:31.8024882Z"
}
},
"tags": [
"foo",
"bar"
],
"secret": true
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parameters": {
"serviceName": "apimService1",
"resourceGroupName": "rg1",
"api-version": "2020-06-01-preview",
"subscriptionId": "subid",
"namedValueId": "testprop6"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6",
"type": "Microsoft.ApiManagement/service/namedValues",
"name": "testprop6",
"properties": {
"displayName": "prop6namekv",
"keyVault": {
"secretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert",
"identityClientId": "2d2df842-44d8-4885-8dec-77cc1a984a31",
"lastStatus": {
"code": "Success",
"timeStampUtc": "2020-09-11T00:54:31.8024882Z"
}
},
"tags": [
"foo",
"bar"
],
"secret": true
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@
}
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testarmTemplateproperties2",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6",
"type": "Microsoft.ApiManagement/service/namedValues",
"name": "testarmTemplateproperties2",
"name": "testprop6",
"properties": {
"displayName": "propName",
"displayName": "prop6namekv",
"keyVault": {
"secretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert",
"identityClientId": "2d2df842-44d8-4885-8dec-77cc1a984a31",
"lastStatus": {
"code": "Success",
"timeStampUtc": "2020-09-11T00:54:31.8024882Z"
}
},
"tags": [
"foo",
"bar"
Expand Down

0 comments on commit 977e3b8

Please sign in to comment.