Skip to content

Commit

Permalink
Update backup/restore API for managed identities (Azure#14973)
Browse files Browse the repository at this point in the history
* Update backup/restore API for system-assigned and user-assigned identities

* Fix formatting issue

* Rename user-assigned-msi-client-id with client-id
  • Loading branch information
JatinSanghvi authored and solankisamir committed Aug 27, 2021
1 parent 5e00606 commit 45eb45b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,30 +128,30 @@
"description": "Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the current service. This is a long running operation and could take several minutes to complete.",
"x-ms-examples": {
"ApiManagementRestoreService": {
"$ref": "./examples/ApiManagementRestoreService.json"
"$ref": "./examples/ApiManagementRestoreWithAccessKey.json"
}
},
"parameters": [
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ApiManagementServiceBackupRestoreParameters"
},
"description": "Parameters supplied to the Restore API Management service from backup operation."
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
"description": "Parameters supplied to the ApiManagementService_Restore operation."
}
],
"responses": {
Expand Down Expand Up @@ -186,16 +186,22 @@
"description": "Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation and could take several minutes to complete.",
"x-ms-examples": {
"ApiManagementCreateBackup": {
"$ref": "./examples/ApiManagementCreateBackup.json"
"$ref": "./examples/ApiManagementBackupWithAccessKey.json"
}
},
"parameters": [
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
{
"name": "parameters",
"in": "body",
Expand All @@ -204,12 +210,6 @@
"$ref": "#/definitions/ApiManagementServiceBackupRestoreParameters"
},
"description": "Parameters supplied to the ApiManagementService_Backup operation."
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
}
],
"responses": {
Expand Down Expand Up @@ -1092,24 +1092,55 @@
"properties": {
"storageAccount": {
"type": "string",
"description": "Azure Cloud Storage account (used to place/retrieve the backup) name."
},
"accessKey": {
"type": "string",
"description": "Azure Cloud Storage account (used to place/retrieve the backup) access key."
"description": "The name of the Azure storage account (used to place/retrieve the backup)."
},
"containerName": {
"type": "string",
"description": "Azure Cloud Storage blob container name used to place/retrieve the backup."
"description": "The name of the blob container (used to place/retrieve the backup)."
},
"backupName": {
"type": "string",
"description": "The name of the backup file to create."
"description": "The name of the backup file to create/retrieve."
},
"accessType": {
"type": "string",
"description": "The type of access to be used for the storage account.",
"default": "AccessKey",
"enum": [
"AccessKey",
"SystemAssignedManagedIdentity",
"UserAssignedManagedIdentity"
],
"x-ms-enum": {
"name": "AccessType",
"modelAsString": true,
"values": [
{
"value": "AccessKey",
"description": "Use access key."
},
{
"value": "SystemAssignedManagedIdentity",
"description": "Use system assigned managed identity."
},
{
"value": "UserAssignedManagedIdentity",
"description": "Use user assigned managed identity."
}
]
}
},
"accessKey": {
"type": "string",
"description": "Storage account access key. Required only if `accessType` is set to `AccessKey`."
},
"clientId": {
"type": "string",
"description": "The Client ID of user assigned managed identity. Required only if `accessType` is set to `UserAssignedManagedIdentity`."
}
},
"required": [
"storageAccount",
"accessKey",
"containerName",
"backupName"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"subscriptionId": "subid",
"parameters": {
"storageAccount": "teststorageaccount",
"accessKey": "**************************************************",
"containerName": "backupContainer",
"backupName": "apimService1backup_2017_03_19"
"backupName": "apimService1backup_2017_03_19",
"accessType": "AccessKey",
"accessKey": "**************************************************"
}
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"subscriptionId": "subid",
"parameters": {
"storageAccount": "teststorageaccount",
"accessKey": "**************************************************",
"containerName": "backupContainer",
"backupName": "apimService1backup_2017_03_19"
"backupName": "apimService1backup_2017_03_19",
"accessType": "AccessKey",
"accessKey": "**************************************************"
}
},
"responses": {
Expand Down

0 comments on commit 45eb45b

Please sign in to comment.