This repository was archived by the owner on May 17, 2023. It is now read-only.
Repository navigation
Feat/national clouds - #52
Merged
Merged
Conversation
Japheth Obala (jobala)
marked this pull request as ready for review
November 23, 2020 07:55
Japheth Obala (jobala)
requested review from
Michael Mainer (MIchaelMainer) and
DeVere Dyett (ddyett)
November 23, 2020 08:45
DeVere Dyett (ddyett)
requested review from
Darrel (darrelmiller) and
Roina Atieno Ochieng (roinochieng)
November 23, 2020 17:53
Contributor
|
how does a user check which cloud they are pointed to. Don't think I see a command for that? |
Contributor
|
can you attach a sample of what the profile.json looks like. makes it easier to follow |
Michael Mainer (MIchaelMainer)
suggested changes
Dec 2, 2020
| if current_cloud and name == current_cloud['name']: | ||
| raise CLIError(f'The cloud "{name}" could not be deleted because it is a current cloud') | ||
|
|
||
| # throw an error if the cloud does not exit |
Contributor
There was a problem hiding this comment.
nit: exist
Michael Mainer (MIchaelMainer)
approved these changes
Dec 2, 2020
|
|
||
| # throw an error if a user attempts to delete a user defined cloud | ||
| if current_cloud and name == current_cloud['name']: | ||
| raise CLIError(f'The cloud "{name}" could not be deleted because it is a current cloud') |
Contributor
There was a problem hiding this comment.
Give instructions to change the current cloud with the command to change it.
Michael Mainer (MIchaelMainer)
approved these changes
Dec 2, 2020
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Overview
New Commands
mg cloud selectfor selecting a cloudmg cloud addfor adding a cloudmg cloud show-currentfor viewing the current cloudmg cloud deletefor deleting user defined cloudsModified Commands
mg cloud loginNow accepts clientd_id & tenant_idDemo
Selecting a cloud

Sample profile.json
{ "cloud": { "name": "Kenya", "graph_endpoint": "https://graph.microsoft.com/v1.0", "azure_ad_endpoint": "https://graph.microsoftonline.com" }, "user_defined_clouds": [ { "Kenya": { "name": "Kenya", "graph_endpoint": "https://graph.microsoft.com/v1.0", "azure_ad_endpoint": "https://graph.microsoftonline.com" } } ] }Notes
Extends the login command with an option to pass a client_id,
mg login --scopes user.read --client-id <client_id>Testing Instructions
mg cloud add --name <name> --endpoint <endpoint> --authority<authority> to add a new cloudmg cloud selectto select a cloudmg cloud show-currentto see the current cloudmg cloud deleteto delete a user defined cloudmg cloud updateto update a cloud