-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0b1c6d4
[Resources/locks] Added GetAtResourceLevel
mcardosos 0d01c1a
[Resources/locks] Fixed descriptions and added ById operations
mcardosos de81df8
Merge master
mcardosos 3b13a80
[Resources/locks] replaced resourceID with scope
mcardosos f5ba0af
[Resources/Locks] More complete scope description
mcardosos 7a8737b
[Resources/Locks] Even more complete scope description
mcardosos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,6 +173,125 @@ | |
} | ||
} | ||
}, | ||
"/{scope}/providers/Microsoft.Authorization/locks/{lockName}": { | ||
"put": { | ||
"tags": [ | ||
"ManagementLocks" | ||
], | ||
"operationId": "ManagementLocks_CreateOrUpdateByScope", | ||
"description": "Create or update a management lock by scope.", | ||
"parameters": [ | ||
{ | ||
"name": "scope", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' for resources." | ||
}, | ||
{ | ||
"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_DeleteByScope", | ||
"description": "Delete a management lock by scope.", | ||
"parameters": [ | ||
{ | ||
"name": "scope", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The scope for the lock. " | ||
}, | ||
{ | ||
"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_GetByScope", | ||
"description": "Get a management lock by scope.", | ||
"parameters": [ | ||
{ | ||
"name": "scope", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The scope for the lock. " | ||
}, | ||
{ | ||
"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": [ | ||
|
@@ -330,6 +449,76 @@ | |
"description": "OK" | ||
} | ||
} | ||
}, | ||
"get": { | ||
"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}": { | ||
|
@@ -414,7 +603,7 @@ | |
"tags": [ | ||
"ManagementLocks" | ||
], | ||
"operationId": "ManagementLocks_Get", | ||
"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 a management lock at the subscription level.", | ||
"parameters": [ | ||
{ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@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 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 ?
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.
@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}