Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if not self.cert_file and not request_session:
if AZURE_MANAGEMENT_CERTFILE in os.environ:
self.cert_file = os.environ[AZURE_MANAGEMENT_CERTFILE]
if not self.subscription_id:
if AZURE_MANAGEMENT_SUBSCRIPTIONID in os.environ:
self.subscription_id = os.environ[
AZURE_MANAGEMENT_SUBSCRIPTIONID]
if not self.request_session:
if not self.cert_file or not self.subscription_id:
raise ValueError(
'You need to provide subscription id and certificate file')
if not self.request_session:
if _ServiceManagementClient.should_use_requests(self.cert_file):
self.request_session = requests.Session()
self.request_session.cert = self.cert_file
self._httpclient = _HTTPClient(
service_instance=self, cert_file=self.cert_file,
request_session=self.request_session, timeout=timeout,
user_agent=_USER_AGENT_STRING)
self._filter = self._httpclient.perform_request
VMImages,
)
from ._common_conversion import (
_str,
)
from ._common_error import (
_validate_not_none,
)
from .servicemanagementclient import (
_ServiceManagementClient,
)
from ._serialization import (
_XmlSerializer,
)
class ComputeManagementService(_ServiceManagementClient):
def __init__(self, subscription_id=None, cert_file=None,
host=MANAGEMENT_HOST, request_session=None,
timeout=DEFAULT_HTTP_TIMEOUT):
'''
Initializes the management service.
subscription_id:
Subscription to manage.
cert_file:
Path to .pem certificate file (httplib), or location of the
certificate in your Personal certificate store (winhttp) in the
CURRENT_USER\my\CertificateName format.
If a request_session is specified, then this is unused.
host:
Live ServiceClient URL. Defaults to Azure public cloud.
Site,
Sites,
WebSpace,
WebSpaces,
)
from .servicemanagementclient import (
_ServiceManagementClient,
)
from ._common_conversion import (
_str,
)
from ._serialization import (
_XmlSerializer,
)
class WebsiteManagementService(_ServiceManagementClient):
''' Note that this class is a preliminary work on WebSite
management. Since it lack a lot a features, final version
can be slightly different from the current one.
'''
def __init__(self, subscription_id=None, cert_file=None,
host=MANAGEMENT_HOST, request_session=None,
timeout=DEFAULT_HTTP_TIMEOUT):
'''
Initializes the website management service.
subscription_id:
Subscription to manage.
cert_file:
Path to .pem certificate file (httplib), or location of the
certificate in your Personal certificate store (winhttp) in the
)
from . import (
EventLog,
ServerQuota,
Servers,
ServiceObjective,
Database,
FirewallRule,
_SqlManagementXmlSerializer,
_MinidomXmlToObject,
)
from .servicemanagementclient import (
_ServiceManagementClient,
)
class SqlDatabaseManagementService(_ServiceManagementClient):
''' Note that this class is a preliminary work on SQL Database
management. Since it lack a lot a features, final version
can be slightly different from the current one.
'''
def __init__(self, subscription_id=None, cert_file=None,
host=MANAGEMENT_HOST, request_session=None,
timeout=DEFAULT_HTTP_TIMEOUT):
'''
Initializes the sql database management service.
subscription_id:
Subscription to manage.
cert_file:
Path to .pem certificate file (httplib), or location of the
certificate in your Personal certificate store (winhttp) in the
)
from ._common_conversion import (
_str,
)
from ._common_error import (
_validate_not_none
)
from .servicemanagementclient import (
_ServiceManagementClient,
)
from ._serialization import (
JSONEncoder,
_SchedulerManagementXmlSerializer,
)
class SchedulerManagementService(_ServiceManagementClient):
''' Note that this class is a preliminary work on Scheduler
management. Since it lack a lot a features, final version
can be slightly different from the current one.
'''
def __init__(self, subscription_id=None, cert_file=None,
host=MANAGEMENT_HOST, request_session=None,
timeout=DEFAULT_HTTP_TIMEOUT):
'''
Initializes the scheduler management service.
subscription_id:
Subscription to manage.
cert_file:
Path to .pem certificate file (httplib), or location of the
NotificationHubDescription,
RelayDescription,
MetricProperties,
MetricValues,
MetricRollups,
_MinidomXmlToObject,
)
from .servicemanagementclient import (
_ServiceManagementClient,
)
from functools import partial
X_MS_VERSION = '2012-03-01'
class ServiceBusManagementService(_ServiceManagementClient):
def __init__(self, subscription_id=None, cert_file=None,
host=MANAGEMENT_HOST, request_session=None,
timeout=DEFAULT_HTTP_TIMEOUT):
'''
Initializes the service bus management service.
subscription_id:
Subscription to manage.
cert_file:
Path to .pem certificate file (httplib), or location of the
certificate in your Personal certificate store (winhttp) in the
CURRENT_USER\my\CertificateName format.
If a request_session is specified, then this is unused.
host:
Live ServiceClient URL. Defaults to Azure public cloud.
if not self.cert_file and not request_session:
if AZURE_MANAGEMENT_CERTFILE in os.environ:
self.cert_file = os.environ[AZURE_MANAGEMENT_CERTFILE]
if not self.subscription_id:
if AZURE_MANAGEMENT_SUBSCRIPTIONID in os.environ:
self.subscription_id = os.environ[
AZURE_MANAGEMENT_SUBSCRIPTIONID]
if not self.request_session:
if not self.cert_file or not self.subscription_id:
raise ValueError(
'You need to provide subscription id and certificate file')
if not self.request_session:
if _ServiceManagementClient.should_use_requests(self.cert_file):
self.request_session = requests.Session()
self.request_session.cert = self.cert_file
self._httpclient = _HTTPClient(
service_instance=self, cert_file=self.cert_file,
request_session=self.request_session, timeout=timeout,
user_agent=_USER_AGENT_STRING)
self._filter = self._httpclient.perform_request
VMImages,
)
from ._common_conversion import (
_str,
)
from ._common_error import (
_validate_not_none,
)
from .servicemanagementclient import (
_ServiceManagementClient,
)
from ._serialization import (
_XmlSerializer,
)
class ServiceManagementService(_ServiceManagementClient):
def __init__(self, subscription_id=None, cert_file=None,
host=MANAGEMENT_HOST, request_session=None,
timeout=DEFAULT_HTTP_TIMEOUT):
'''
Initializes the management service.
subscription_id:
Subscription to manage.
cert_file:
Path to .pem certificate file (httplib), or location of the
certificate in your Personal certificate store (winhttp) in the
CURRENT_USER\my\CertificateName format.
If a request_session is specified, then this is unused.
host:
Live ServiceClient URL. Defaults to Azure public cloud.