This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from davidkydd/master
AAD and Batch Container Image support, prep for v0.23.0 release
- Loading branch information
Showing
54 changed files
with
5,236 additions
and
727 deletions.
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
import json | ||
import sys | ||
import traceback | ||
from collections import OrderedDict | ||
|
||
from msrestazure.azure_cloud import AZURE_CHINA_CLOUD, AZURE_PUBLIC_CLOUD, AZURE_GERMAN_CLOUD, AZURE_US_GOV_CLOUD | ||
|
||
AAD_ENVIRONMENTS = OrderedDict() | ||
AAD_ENVIRONMENTS[AZURE_PUBLIC_CLOUD.name] = AZURE_PUBLIC_CLOUD | ||
AAD_ENVIRONMENTS[AZURE_CHINA_CLOUD.name] = AZURE_CHINA_CLOUD | ||
AAD_ENVIRONMENTS[AZURE_GERMAN_CLOUD.name] = AZURE_GERMAN_CLOUD | ||
AAD_ENVIRONMENTS[AZURE_US_GOV_CLOUD.name] = AZURE_US_GOV_CLOUD | ||
|
||
class AADEnvironmentProvider(object): | ||
|
||
def __init__(self, aad_environments = AAD_ENVIRONMENTS): | ||
self.aadEnvironments = aad_environments | ||
|
||
def getAADEnvironments(self): | ||
return self.aadEnvironments | ||
|
||
def getEnvironmentForId(self, id): | ||
return AAD_ENVIRONMENTS[id] | ||
|
||
def getAadAuthorityHostUrl(self, id): | ||
return AAD_ENVIRONMENTS[id].endpoints.active_directory | ||
|
||
def getAadManagementUrl(self, id): | ||
return AAD_ENVIRONMENTS[id].endpoints.active_directory_resource_id | ||
|
||
def getBatchResourceUrl(self, id): | ||
return AAD_ENVIRONMENTS[id].endpoints.batch_resource_id | ||
|
||
def getResourceManager(self, id): | ||
return AAD_ENVIRONMENTS[id].endpoints.resource_manager |
Oops, something went wrong.