Skip to content

Commit

Permalink
API Management Service Deleted Services Resource (#10607)
Browse files Browse the repository at this point in the history
* API Management Service Deleted Services Resource

* Path fix

* Lint + custom-words fixes

* Location URI parameter for deletedservices Resource

* GET for deletedservices by service name

* Remove resourceGroupName from resource path

* fixes

* schema for purge operation

* perttier applied

* 204 response code added

Co-authored-by: REDMOND\glfeokti <glfeokti@microsoft.com>
  • Loading branch information
promoisha and REDMOND\glfeokti authored Sep 4, 2020
1 parent 4e353d1 commit 6d58791
Show file tree
Hide file tree
Showing 9 changed files with 441 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ deleteconsumergroup
deletedcertificates
deletedkeys
deletedsecrets
deletedservices
deletedstorage
deletefailed
deleteissuers
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"swagger": "2.0",
"info": {
"title": "ApiManagementClient",
"description": "Use these REST APIs for performing operations in Azure API Management deployment.",
"version": "2020-06-01-preview"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow.",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices": {
"get": {
"tags": [
"DeletedService"
],
"operationId": "DeletedServices_ListBySubscription",
"description": "Lists all soft-deleted services available for undelete for the given subscription.",
"x-ms-examples": {
"ApiManagementListRegions": {
"$ref": "./examples/ApiManagementDeletedServicesListBySubscription.json"
}
},
"parameters": [
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "List of all soft-deleted services available for undelete for the given subscription.",
"schema": {
"$ref": "./definitions.json#/definitions/DeletedServicesCollection"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}": {
"get": {
"tags": [
"DeletedService"
],
"operationId": "DeletedServices_GetByName",
"description": "Get soft-deleted Api Management Service by name.",
"x-ms-examples": {
"ApiManagementListRegions": {
"$ref": "./examples/ApiManagementGetDeletedServiceByName.json"
}
},
"parameters": [
{
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
},
{
"name": "location",
"in": "path",
"required": true,
"type": "string",
"description": "The location of the deleted API Management service."
}
],
"responses": {
"200": {
"description": "Soft-deleted Api Management Service.",
"schema": {
"$ref": "./definitions.json#/definitions/DeletedServiceContract"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
}
}
}
},
"delete": {
"tags": [
"DeletedService"
],
"operationId": "DeletedServices_Purge",
"description": "Purges Api Management Service (deletes it with no option to undelete).",
"x-ms-examples": {
"ApiManagementListRegions": {
"$ref": "./examples/ApiManagementDeletedServicesPurge.json"
}
},
"parameters": [
{
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
},
{
"name": "location",
"in": "path",
"required": true,
"type": "string",
"description": "The location of the deleted API Management service."
}
],
"responses": {
"200": {
"description": "Api Service was successfully purged."
},
"202": {
"description": "Api Service purge started.",
"schema": {
"$ref": "./definitions.json#/definitions/DeletedServiceContract"
}
},
"204": {
"description": "The service does not exist."
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
}
}
}
}
}
},
"definitions": {},
"parameters": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@
},
"ApiManagementCreateServiceInZones": {
"$ref": "./examples/ApiManagementCreateServiceInZones.json"
},
"ApiManagementUndelete": {
"$ref": "./examples/ApiManagementUndelete.json"
}
},
"parameters": [
Expand Down Expand Up @@ -1204,6 +1207,11 @@
"apiVersionConstraint": {
"$ref": "#/definitions/ApiVersionConstraint",
"description": "Control Plane Apis version constraint for the API Management service."
},
"restore": {
"type": "boolean",
"description": "Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored.",
"default": false
}
},
"description": "Base Properties of an API Management service resource description."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5703,6 +5703,62 @@
"ContentItemContractProperties": {
"properties": {},
"additionalProperties": true
},
"DeletedServicesCollection": {
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/DeletedServiceContract"
},
"description": "Page values.",
"readOnly": true
},
"nextLink": {
"type": "string",
"description": "Next page link if any.",
"readOnly": true
}
},
"description": "Paged deleted Api Management Services List Representation."
},
"DeletedServiceContract": {
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/DeletedServiceContractProperties",
"description": "Deleted Api Management Service details."
},
"location": {
"readOnly": true,
"type": "string",
"description": "Api Management Service Master Location."
}
},
"allOf": [
{
"$ref": "./apimanagement.json#/definitions/Resource"
}
],
"description": "Deleted Api Management Service information."
},
"DeletedServiceContractProperties": {
"properties": {
"serviceId": {
"type": "string",
"description": "Fully-qualified API Management Service Resource ID"
},
"scheduledPurgeDate": {
"type": "string",
"format": "date-time",
"description": "UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard."
},
"deletionDate": {
"type": "string",
"format": "date-time",
"description": "UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard."
}
}
}
},
"parameters": {}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parameters": {
"api-version": "2020-06-01-preview",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/subid/providers/Microsoft.ApiManagement/locations/westus/deletedservices/apimService3",
"name": "apimService3",
"type": "Microsoft.ApiManagement/deletedservices",
"location": "West US",
"properties": {
"serviceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService3",
"scheduledPurgeDate": "2017-05-27T15:33:55.5426123Z",
"deletionDate": "2017-05-27T15:33:55.5426123Z"
}
},
{
"id": "/subscriptions/subid/providers/Microsoft.ApiManagement/locations/westus2/deletedservices/apimService",
"name": "apimService",
"type": "Microsoft.ApiManagement/deletedservices",
"location": "West US 2",
"properties": {
"serviceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService",
"scheduledPurgeDate": "2017-05-27T15:33:55.5426123Z",
"deletionDate": "2017-05-27T15:33:55.5426123Z"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"parameters": {
"serviceName": "apimService3",
"api-version": "2020-06-01-preview",
"subscriptionId": "subid",
"location": "westus"
},
"responses": {
"202": {
"headers": {
"location": "https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/locations/westus/deletedservices/apimService3/operationresults/TGV2eTExMDZtMDJfVGVybV9jMmZlY2QwMA==?api-version=2020-06-01-preview"
},
"body": {
"id": "/subscriptions/subid/providers/Microsoft.ApiManagement/locations/westus/deletedservices/apimService3",
"name": "apimService3",
"type": "Microsoft.ApiManagement/deletedservices",
"location": "West US",
"properties": {
"serviceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService3",
"scheduledPurgeDate": "2017-05-27T15:33:55.5426123Z",
"deletionDate": "2017-05-27T15:33:55.5426123Z"
}
}
},
"200": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"parameters": {
"serviceName": "apimService3",
"api-version": "2020-06-01-preview",
"subscriptionId": "subid",
"location": "westus"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/providers/Microsoft.ApiManagement/locations/westus/deletedservices/apimService3",
"name": "apimService3",
"type": "Microsoft.ApiManagement/deletedservices",
"location": "West US",
"properties": {
"serviceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService3",
"scheduledPurgeDate": "2017-05-27T15:33:55.5426123Z",
"deletionDate": "2017-05-27T15:33:55.5426123Z"
}
}
}
}
}
Loading

0 comments on commit 6d58791

Please sign in to comment.