Skip to content
This repository was archived by the owner on May 17, 2023. It is now read-only.

Feat/national clouds - #52

Merged
Japheth Obala (jobala) merged 32 commits into
devfrom
feat/national-clouds
Dec 2, 2020
Merged

Japheth Obala (jobala) merged 32 commits into
devfrom
feat/national-clouds

Conversation

@jobala

@jobala Japheth Obala (jobala) commented Nov 21, 2020 •

Copy link
Copy Markdown
Contributor

Overview

New Commands

  • mg cloud select for selecting a cloud
  • mg cloud add for adding a cloud
  • mg cloud show-current for viewing the current cloud
  • mg cloud delete for deleting user defined clouds

Modified Commands

  • mg cloud login Now accepts clientd_id & tenant_id

Demo

Selecting a cloud
image

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

  • Pull this PR
  • Build & start the docker container, instructions are in README.md
  • Run mg cloud add --name <name> --endpoint <endpoint> --authority<authority> to add a new cloud
  • Run mg cloud select to select a cloud
  • Run mg cloud show-current to see the current cloud
  • Run mg cloud delete to delete a user defined cloud
  • Run mg cloud update to update a cloud

@ddyett

Copy link
Copy Markdown
Contributor

how does a user check which cloud they are pointed to. Don't think I see a command for that?

@ddyett

Copy link
Copy Markdown
Contributor

can you attach a sample of what the profile.json looks like. makes it easier to follow

Comment thread msgraph/cli/core/constants.py Resolved
Comment thread msgraph/cli/core/constants.py Resolved
Comment thread msgraph/cli/core/constants.py Resolved
Comment thread msgraph/cli/core/authentication.py Resolved
Comment thread msgraph/cli/core/constants.py Resolved
@ddyett DeVere Dyett (ddyett) linked an issue Nov 30, 2020 that may be closed by this pull request
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: exist


# 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')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Give instructions to change the current cloud with the command to change it.

@jobala
Japheth Obala (jobala) merged commit d3b6030 into dev Dec 2, 2020
@jobala
Japheth Obala (jobala) deleted the feat/national-clouds branch December 2, 2020 22:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for national clouds

4 participants