-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Changes from 2 commits
0b1c6d4
0d01c1a
de81df8
3b13a80
f5ba0af
7a8737b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,6 +170,125 @@ | |
} | ||
} | ||
}, | ||
"/{resourceId}/providers/Microsoft.Authorization/locks/{lockName}": { | ||
"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": [ | ||
|
@@ -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", | ||
|
@@ -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", | ||
|
@@ -325,6 +444,76 @@ | |
"description": "OK" | ||
} | ||
} | ||
}, | ||
"get": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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}": { | ||
|
@@ -407,8 +596,8 @@ | |
"tags": [ | ||
"ManagementLocks" | ||
], | ||
"operationId": "ManagementLocks_Get", | ||
"description": "Gets the management lock of a scope.", | ||
"operationId": "ManagementLocks_GetAtSubscriptionLevel", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vivsriaus @TianoMS - |
||
"description": "Gets the management lock of a subscription.", | ||
"parameters": [ | ||
{ | ||
"name": "lockName", | ||
|
@@ -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", | ||
|
There was a problem hiding this comment.
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