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

[Resources/locks] Added GetAtResourceLevel #666

Merged
merged 6 commits into from
Dec 21, 2016
Merged
Changes from 2 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
217 changes: 203 additions & 14 deletions arm-resources/locks/2016-09-01/swagger/locks.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,125 @@
}
}
},
"/{resourceId}/providers/Microsoft.Authorization/locks/{lockName}": {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we please replace {resourceId} with {scope}. In ARM specs, resourceId signifies the fully qualified Id of a resource

"put": {
"tags": [
"ManagementLocks"
],
"operationId": "ManagementLocks_CreateOrUpdateById",
"description": "Create or update a management lock by resource id.",
"parameters": [
{
"name": "resourceId",
"in": "path",
"required": true,
"type": "string",
"description": "The resource id. "
},
{
"name": "lockName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of lock."
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ManagementLockObject"
},
"description": "Create or update management lock parameters."
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ManagementLockObject"
}
},
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/ManagementLockObject"
}
}
}
},
"delete": {
"tags": [
"ManagementLocks"
],
"operationId": "ManagementLocks_DeleteById",
"description": "Delete a management lock by resource id.",
"parameters": [
{
"name": "resourceId",
"in": "path",
"required": true,
"type": "string",
"description": "The resource id. "
},
{
"name": "lockName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of lock."
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"204": {
"description": "NoContent"
},
"200": {
"description": "OK"
}
}
},
"get": {
"tags": [
"ManagementLocks"
],
"operationId": "ManagementLocks_GetById",
"description": "Get a management lock by resource id.",
"parameters": [
{
"name": "resourceId",
"in": "path",
"required": true,
"type": "string",
"description": "The resource id. "
},
{
"name": "lockName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of lock."
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ManagementLockObject"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}": {
"put": {
"tags": [
Expand All @@ -193,30 +312,30 @@
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity."
"description": "The namespace of the resource provider."
},
{
"name": "parentResourcePath",
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity.",
"description": "An extra path parameter needed in some services, like SQL Databases.",
"x-ms-skip-url-encoding": true
},
{
"name": "resourceType",
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity.",
"description": "The type of the resource.",
"x-ms-skip-url-encoding": true
},
{
"name": "resourceName",
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity."
"description": "The name of the resource."
},
{
"name": "lockName",
Expand Down Expand Up @@ -278,30 +397,30 @@
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity."
"description": "The namespace of the resource provider."
},
{
"name": "parentResourcePath",
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity.",
"description": "An extra path parameter needed in some services, like SQL Databases.",
"x-ms-skip-url-encoding": true
},
{
"name": "resourceType",
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity.",
"description": "The type of the resource.",
"x-ms-skip-url-encoding": true
},
{
"name": "resourceName",
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity."
"description": "The name of the resource."
},
{
"name": "lockName",
Expand All @@ -325,6 +444,76 @@
"description": "OK"
}
}
},
"get": {
Copy link
Contributor

Choose a reason for hiding this comment

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

@vivsriaus @TianoMS - Looks like these APIs were missing. @mcardosos from the Azure Go SDK team found this by looking at the MSDN REST API docs. Can you please review the changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}"

"{resourceId}/providers/Microsoft.Authorization/locks/{lockName}"

@TianoMS @vivsriaus - Do you think having the version with resourceId would be helpful ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@amarzavery Yes, we've received feedback from people, saying the methods that take in parentResourcePath is not at all intuitive. It is pretty cumbersome to construct the request URI for the above using parentResourcePath. A simpler implementation would be the one suggested by you (similar to this) or a path that points to a a fully qualified /{lockId}

"tags": [
"ManagementLocks"
],
"operationId": "ManagementLocks_GetAtResourceLevel",
"description": "Get the management lock of a resource or any level below resource.",
"parameters": [
{
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group. ",
"pattern": "^[-\\w\\._\\(\\)]+$",
"minLength": 1,
"maxLength": 90
},
{
"name": "resourceProviderNamespace",
"in": "path",
"required": true,
"type": "string",
"description": "The namespace of the resource provider."
},
{
"name": "parentResourcePath",
"in": "path",
"required": true,
"type": "string",
"description": "An extra path parameter needed in some services, like SQL Databases.",
"x-ms-skip-url-encoding": true
},
{
"name": "resourceType",
"in": "path",
"required": true,
"type": "string",
"description": "The type of the resource.",
"x-ms-skip-url-encoding": true
},
{
"name": "resourceName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource."
},
{
"name": "lockName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of lock."
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ManagementLockObject"
}
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}": {
Expand Down Expand Up @@ -407,8 +596,8 @@
"tags": [
"ManagementLocks"
],
"operationId": "ManagementLocks_Get",
"description": "Gets the management lock of a scope.",
"operationId": "ManagementLocks_GetAtSubscriptionLevel",
Copy link
Contributor

Choose a reason for hiding this comment

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

@vivsriaus @TianoMS -
This will be a breaking change in the SDK. It is the correct change though. Is this acceptable?

"description": "Gets the management lock of a subscription.",
"parameters": [
{
"name": "lockName",
Expand Down Expand Up @@ -503,30 +692,30 @@
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity."
"description": "The namespace of the resource provider."
},
{
"name": "parentResourcePath",
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity.",
"description": "An extra path parameter needed in some services, like SQL Databases.",
"x-ms-skip-url-encoding": true
},
{
"name": "resourceType",
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity.",
"description": "The type of the resource.",
"x-ms-skip-url-encoding": true
},
{
"name": "resourceName",
"in": "path",
"required": true,
"type": "string",
"description": "Resource identity."
"description": "The name of the resource."
},
{
"name": "$filter",
Expand Down