How to use the msrestazure.azure_cloud.AZURE_US_GOV_CLOUD function in msrestazure

To help you get started, we’ve selected a few msrestazure examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github f5devcentral / f5-azure-saca / grab_vars.py View on Github external
#!/usr/bin/env python
from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.resource import ResourceManagementClient

from azure.mgmt.network import NetworkManagementClient
from azure.mgmt.compute import ComputeManagementClient
from azure.mgmt.resource.resources.models import DeploymentMode

from msrestazure.azure_cloud import AZURE_US_GOV_CLOUD
from msrestazure.azure_cloud import AZURE_PUBLIC_CLOUD

import os

if os.environ.get("is_gov") == "1":
    mycloud = AZURE_US_GOV_CLOUD
else:
    mycloud = AZURE_PUBLIC_CLOUD

from optparse import OptionParser

parser = OptionParser()
parser.add_option('--action',help="external|internal|complete")
parser.add_option('--debug',action="store_true")
parser.add_option('--private',action="store_true")
(options, args) = parser.parse_args()

import os
import pprint
import re
import sys
import json
github Azure / batch-shipyard / heimdall / heimdall.py View on Github external
def convert_cloud_type(cloud_type: str) -> msrestazure.azure_cloud.Cloud:
    """Convert clout type string to object
    :param cloud_type: cloud type to convert
    :return: cloud object
    """
    if cloud_type == 'public':
        cloud = msrestazure.azure_cloud.AZURE_PUBLIC_CLOUD
    elif cloud_type == 'china':
        cloud = msrestazure.azure_cloud.AZURE_CHINA_CLOUD
    elif cloud_type == 'germany':
        cloud = msrestazure.azure_cloud.AZURE_GERMAN_CLOUD
    elif cloud_type == 'usgov':
        cloud = msrestazure.azure_cloud.AZURE_US_GOV_CLOUD
    else:
        raise ValueError('unknown cloud_type: {}'.format(cloud_type))
    return cloud