-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Subscription RP] create subscription command #119
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b04b404
Upgrade to latest Python subscription SDK
wilcobmsft 857a4f6
style fixes
wilcobmsft 6110bb9
style fix
wilcobmsft dd9d483
Style fix
wilcobmsft d910a35
style fix
wilcobmsft 4c499ec
Addressing PR feedback:
wilcobmsft ad1e07b
Merge branch 'master' into wilcob/createSubscription
wilcobmsft 74c7979
Improve parameter names.
wilcobmsft e65df5d
Merge branch 'master' into wilcob/createSubscription
derekbekoe 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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| { | ||
| "azext.minCliCoreVersion": "2.0.24" | ||
| "azext.minCliCoreVersion": "2.0.30", | ||
| "azext.isPreview": true | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
34 changes: 34 additions & 0 deletions
34
src/subscription/azext_subscription/subscription/models/ad_principal.py
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for | ||
| # license information. | ||
| # | ||
| # Code generated by Microsoft (R) AutoRest Code Generator. | ||
| # Changes may cause incorrect behavior and will be lost if the code is | ||
| # regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from msrest.serialization import Model | ||
|
|
||
|
|
||
| class AdPrincipal(Model): | ||
| """Active Directory Principal for subscription creation delegated permission. | ||
|
|
||
| All required parameters must be populated in order to send to Azure. | ||
|
|
||
| :param object_id: Required. Object id of the Principal | ||
| :type object_id: str | ||
| """ | ||
|
|
||
| _validation = { | ||
| 'object_id': {'required': True}, | ||
| } | ||
|
|
||
| _attribute_map = { | ||
| 'object_id': {'key': 'objectId', 'type': 'str'}, | ||
| } | ||
|
|
||
| def __init__(self, **kwargs): | ||
| super(AdPrincipal, self).__init__(**kwargs) | ||
| self.object_id = kwargs.get('object_id', None) |
34 changes: 34 additions & 0 deletions
34
src/subscription/azext_subscription/subscription/models/ad_principal_py3.py
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for | ||
| # license information. | ||
| # | ||
| # Code generated by Microsoft (R) AutoRest Code Generator. | ||
| # Changes may cause incorrect behavior and will be lost if the code is | ||
| # regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from msrest.serialization import Model | ||
|
|
||
|
|
||
| class AdPrincipal(Model): | ||
| """Active Directory Principal for subscription creation delegated permission. | ||
|
|
||
| All required parameters must be populated in order to send to Azure. | ||
|
|
||
| :param object_id: Required. Object id of the Principal | ||
| :type object_id: str | ||
| """ | ||
|
|
||
| _validation = { | ||
| 'object_id': {'required': True}, | ||
| } | ||
|
|
||
| _attribute_map = { | ||
| 'object_id': {'key': 'objectId', 'type': 'str'}, | ||
| } | ||
|
|
||
| def __init__(self, *, object_id: str, **kwargs) -> None: | ||
| super(AdPrincipal, self).__init__(**kwargs) | ||
| self.object_id = object_id |
This file contains hidden or 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
45 changes: 45 additions & 0 deletions
45
src/subscription/azext_subscription/subscription/models/error_response_py3.py
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for | ||
| # license information. | ||
| # | ||
| # Code generated by Microsoft (R) AutoRest Code Generator. | ||
| # Changes may cause incorrect behavior and will be lost if the code is | ||
| # regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from msrest.serialization import Model | ||
| from msrest.exceptions import HttpOperationError | ||
|
|
||
|
|
||
| class ErrorResponse(Model): | ||
| """Describes the format of Error response. | ||
|
|
||
| :param code: Error code | ||
| :type code: str | ||
| :param message: Error message indicating why the operation failed. | ||
| :type message: str | ||
| """ | ||
|
|
||
| _attribute_map = { | ||
| 'code': {'key': 'code', 'type': 'str'}, | ||
| 'message': {'key': 'message', 'type': 'str'}, | ||
| } | ||
|
|
||
| def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: | ||
| super(ErrorResponse, self).__init__(**kwargs) | ||
| self.code = code | ||
| self.message = message | ||
|
|
||
|
|
||
| class ErrorResponseException(HttpOperationError): | ||
| """Server responsed with exception of type: 'ErrorResponse'. | ||
|
|
||
| :param deserialize: A deserializer | ||
| :param response: Server response to be deserialized. | ||
| """ | ||
|
|
||
| def __init__(self, deserialize, response, *args): | ||
|
|
||
| super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) |
This file contains hidden or 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
Oops, something went wrong.
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.
spn/upnis supposed to be unique, I would suggest you just error out here as such situation should not occurThere 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.
This code is copied from KeyVault's policy handling. The parameter names (object_id/spn/upn) also reflect what both the KeyVault and AuthZ modules are doing. Ideally there'd be a separate change to address this feedback across all modules. What do you think?
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.
Sounds good to me