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

[Microsoft.StorageSync] Update 2020-03-01 and 2020-09-01 specifications to address swagger correctness and completeness items. #16041

Merged
merged 5 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -0,0 +1,23 @@
{
"parameters": {
"subscriptionId": "52b8da2f-61e0-4a1f-8dde-336911f367fb",
"locationName": "westus",
"operationId": "eyJwYXJ0aXRpb25JZCI6ImE1ZDNiMDU4LTYwN2MtNDI0Ny05Y2FmLWJlZmU4NGQ0ZDU0NyIsIndvcmtmbG93SWQiOiJjYzg1MTY2YS0xMjI2LTQ4MGYtYWM5ZC1jMmRhNTVmY2M2ODYiLCJ3b3JrZmxvd09wZXJhdGlvbklkIjoiOTdmODU5ZTAtOGY1MC00ZTg4LWJkZDEtNWZlYzgwYTVlYzM0tui=",
"api-version": "2020-03-01"
},
"responses": {
"200": {
"headers": {
"x-ms-request-id": "74e55a4d-1c6f-46de-9a8d-278e53a47403",
"x-ms-correlation-request-id": "d166ca76-dad2-49df-b409-d2acfd42d730"
},
"body": {
"id": "/subscriptions/52b8da2f-61e0-4a1f-8dde-336911f367fb/providers/microsoft.storagesync/locations/westus/operations/eyJwYXJ0aXRpb25JZCI6ImE1ZDNiMDU4LTYwN2MtNDI0Ny05Y2FmLWJlZmU4NGQ0ZDU0NyIsIndvcmtmbG93SWQiOiJjYzg1MTY2YS0xMjI2LTQ4MGYtYWM5ZC1jMmRhNTVmY2M2ODYiLCJ3b3JrZmxvd09wZXJhdGlvbklkIjoiOTdmODU5ZTAtOGY1MC00ZTg4LWJkZDEtNWZlYzgwYTVlYzM0tui=",
"name": "eyJwYXJ0aXRpb25JZCI6ImE1ZDNiMDU4LTYwN2MtNDI0Ny05Y2FmLWJlZmU4NGQ0ZDU0NyIsIndvcmtmbG93SWQiOiJjYzg1MTY2YS0xMjI2LTQ4MGYtYWM5ZC1jMmRhNTVmY2M2ODYiLCJ3b3JrZmxvd09wZXJhdGlvbklkIjoiOTdmODU5ZTAtOGY1MC00ZTg4LWJkZDEtNWZlYzgwYTVlYzM0tui=",
"status": "Succeeded",
"startTime": "2021-09-14T19:59:24.6247688Z",
"endTime": "2021-09-14T19:59:30.8055279Z"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3071,6 +3071,66 @@
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/operations/{operationId}": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anpint
Your spec defines operations API as /subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/operations/{operationId}
But the examples use operationResults in the ID. Which one is correct?

Can you point me to your S360 error?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per our offline discussion I understand the resource name 'operations' is correct and is what your shipped API is using for Azure-AsyncOperation format. The resourceName should be 'operationStatuses'. Refer https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format

The resource name 'operations' confuses with RP general operations API. Please add a work item to fix the resource name in future API versions.

I am signing off now as this is an existing API and you are trying to fix S360 error.

"get": {
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
},
{
"name": "locationName",
"in": "path",
"required": true,
"type": "string",
"description": "The desired region to obtain information from."
},
{
"name": "operationId",
"in": "path",
"description": "operation Id",
"required": true,
"type": "string"
}
],
"tags": [
"Operation Status"
],
"operationId": "LocationOperationStatus",
"description": "Get Operation status",
"x-ms-examples": {
"Workflows_Get": {
"$ref": "./examples/LocationOperationStatus_Get.json"
}
},
"responses": {
"200": {
"description": "Operation Status",
"schema": {
"$ref": "#/definitions/LocationOperationStatus"
},
"headers": {
"x-ms-request-id": {
"description": "request id.",
"type": "string"
},
"x-ms-correlation-request-id": {
"description": "correlation request id.",
"type": "string"
}
}
},
"default": {
"description": "Error message indicating why the operation failed.",
"schema": {
"$ref": "#/definitions/StorageSyncError"
}
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -3107,6 +3167,10 @@
"details": {
"$ref": "#/definitions/StorageSyncErrorDetails",
"description": "Error details of the given entry."
},
"innerError": {
"$ref": "#/definitions/StorageSyncInnerErrorDetails",
"description": "Inner error details of the given entry."
}
}
},
Expand All @@ -3125,6 +3189,48 @@
"target": {
"type": "string",
"description": "Target of the given entry."
},
"requestUri": {
"type": "string",
"description": "Request URI of the given entry."
},
"exceptionType": {
"type": "string",
"description": "Exception type of the given entry."
},
"httpMethod": {
"type": "string",
"description": "HTTP method of the given entry."
},
"hashedMessage": {
"type": "string",
"description": "Hashed message of the given entry."
},
"httpErrorCode": {
"type": "string",
"description": "HTTP error code of the given entry."
}
}
},
"StorageSyncInnerErrorDetails": {
"type": "object",
"description": "Error Details object.",
"properties": {
"callStack": {
"type": "string",
"description": "Call stack of the error."
},
"message": {
"type": "string",
"description": "Error message of the error."
},
"innerException": {
"type": "string",
"description": "Exception of the inner error."
},
"innerExceptionCallStack": {
"type": "string",
"description": "Call stack of the inner error."
}
}
},
Expand Down Expand Up @@ -3396,11 +3502,13 @@
},
"initialDownloadPolicy": {
"$ref": "#/definitions/InitialDownloadPolicy",
"description": "Policy for how namespace and files are recalled during FastDr."
"description": "Policy for how namespace and files are recalled during FastDr.",
"default": "NamespaceThenModifiedFiles"
},
"localCacheMode": {
"$ref": "#/definitions/LocalCacheMode",
"description": "Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access."
"description": "Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access.",
"default": "UpdateLocallyCachedFiles"
}
}
},
Expand Down Expand Up @@ -3578,6 +3686,10 @@
"origin": {
"type": "string",
"description": "The origin."
},
"properties": {
"$ref": "#/definitions/OperationProperties",
"description": "Properties of the operations resource."
}
}
},
Expand Down Expand Up @@ -3625,6 +3737,84 @@
}
}
},
"OperationProperties": {
"type": "object",
"description": "Properties of the operations resource.",
"properties": {
"serviceSpecification": {
"$ref": "#/definitions/OperationResourceServiceSpecification",
"description": "Service specification for the operations resource."
}
}
},
"OperationResourceServiceSpecification": {
"type": "object",
"description": "Service specification.",
"properties": {
"metricSpecifications": {
"type": "array",
"items": {
"$ref": "#/definitions/OperationResourceMetricSpecification"
},
"description": "List of metric specifications."
}
}
},
"OperationResourceMetricSpecification": {
"type": "object",
"description": "Operation Display Resource object.",
"properties": {
"name": {
"type": "string",
"description": "Name of the metric."
},
"displayName": {
"type": "string",
"description": "Display name for the metric."
},
"displayDescription": {
"type": "string",
"description": "Display description for the metric."
},
"unit": {
"type": "string",
"description": "Unit for the metric."
},
"aggregationType": {
"type": "string",
"description": "Aggregation type for the metric."
},
"fillGapWithZero": {
"type": "boolean",
"description": "Fill gaps in the metric with zero."
},
"dimensions": {
"type": "array",
"items": {
"$ref": "#/definitions/OperationResourceMetricSpecificationDimension"
},
"description": "Dimensions for the metric specification."
}
}
},
"OperationResourceMetricSpecificationDimension": {
"type": "object",
"description": "OperationResourceMetricSpecificationDimension object.",
"properties": {
"name": {
"type": "string",
"description": "Name of the dimension."
},
"displayName": {
"type": "string",
"description": "Display name of the dimensions."
},
"toBeExportedForShoebox": {
"type": "boolean",
"description": "Indicates metric should be exported for Shoebox."
}
}
},
"CheckNameAvailabilityParameters": {
"properties": {
"name": {
Expand Down Expand Up @@ -4017,6 +4207,17 @@
"type": "string",
"description": "Registered Server Agent Version"
},
"agentVersionStatus": {
"$ref": "#/definitions/RegisteredServerAgentVersionStatus",
"description": "Registered Server Agent Version Status",
"readOnly": true
},
"agentVersionExpirationDate": {
"type": "string",
"format": "date-time",
"description": "Registered Server Agent Version Expiration Date",
"readOnly": true
},
"serverOSVersion": {
"type": "string",
"description": "Registered Server OS Version"
Expand Down Expand Up @@ -4375,6 +4576,11 @@
},
"description": "Array of per-item errors coming from the last sync session.",
"readOnly": true
},
"lastSyncMode": {
"$ref": "#/definitions/ServerEndpointSyncMode",
"description": "Sync mode",
"readOnly": true
}
}
},
Expand Down Expand Up @@ -4422,6 +4628,11 @@
"minimum": 0,
"description": "Total bytes (if available)",
"readOnly": true
},
"syncMode": {
"$ref": "#/definitions/ServerEndpointSyncMode",
"description": "Sync mode",
"readOnly": true
}
}
},
Expand Down Expand Up @@ -4451,6 +4662,21 @@
}
}
},
"ServerEndpointSyncMode": {
"type": "string",
"description": "Sync mode for the server endpoint.",
"enum": [
"Regular",
"NamespaceDownload",
"InitialUpload",
"SnapshotUpload",
"InitialFullDownload"
],
"x-ms-enum": {
"name": "ServerEndpointSyncMode",
"modelAsString": true
}
},
"PhysicalPath": {
"type": "string",
"description": "Server folder used for data synchronization"
Expand Down Expand Up @@ -4630,6 +4856,50 @@
},
"description": "Operation status object"
},
"LocationOperationStatus": {
"type": "object",
"properties": {
"id": {
"readOnly": true,
"type": "string",
"description": "Operation resource Id"
},
"name": {
"readOnly": true,
"type": "string",
"description": "Operation Id"
},
"status": {
"readOnly": true,
"type": "string",
"description": "Operation status"
},
"startTime": {
"readOnly": true,
"type": "string",
"format": "date-time",
"description": "Start time of the operation"
},
"endTime": {
"readOnly": true,
"type": "string",
"format": "date-time",
"description": "End time of the operation"
},
"error": {
"readOnly": true,
"$ref": "#/definitions/StorageSyncApiError",
"description": "Error details."
},
"percentComplete": {
"readOnly": true,
"type": "integer",
"format": "int32",
"description": "Percent complete."
}
},
"description": "Operation status object"
},
"ServerEndpointCloudTieringStatus": {
"type": "object",
"description": "Server endpoint cloud tiering status object.",
Expand Down Expand Up @@ -4921,6 +5191,20 @@
"readOnly": true
}
}
},
"RegisteredServerAgentVersionStatus": {
"type": "string",
"description": "Type of the registered server agent version status",
"enum": [
"Ok",
"NearExpiry",
"Expired",
"Blocked"
],
"x-ms-enum": {
"name": "RegisteredServerAgentVersionStatus",
"modelAsString": true
}
}
},
"parameters": {
Expand Down
Loading