def __init__(self, management_cert_path, subscription_id): from hostedservices import HostedServices, ServiceConfiguration from storageaccounts import StorageAccounts from locations import Locations self.service_api = HostedServices(management_cert_path, subscription_id) self.ServiceConfiguration = ServiceConfiguration self.storage_api = StorageAccounts(management_cert_path, subscription_id) self.location_api = Locations(management_cert_path, subscription_id) self._sme = ServiceManagementEndpoint(management_cert_path, subscription_id) self.WASMError = WASMError self.get_operation_status = self._sme.get_operation_status self.request_done = self._sme.request_done self.wait_for_request = self._sme.wait_for_request for op in self.service_api.get_wasm_ops(): setattr(self, op.__name__, op) for op in self.storage_api.get_wasm_ops(): setattr(self, op.__name__, op) for op in self.location_api.get_wasm_ops(): setattr(self, op.__name__, op)
def __init__(self, management_cert_path, subscription_id, management_key_path=None): """Initialise the various API interfaces. Note that management_key_path is not required (except for Python 2.5), as the key can be included in the certificate chain file. The OpenSSL command line can create an appropriate PEM file like so: openssl pkcs12 -in azure.pfx -out azure.pem -nodes """ from hostedservices import HostedServices, ServiceConfiguration from storageaccounts import StorageAccounts from locations import Locations self.service_api = HostedServices(management_cert_path, subscription_id, management_key_path) self.ServiceConfiguration = ServiceConfiguration self.storage_api = StorageAccounts(management_cert_path, subscription_id, management_key_path) self.location_api = Locations(management_cert_path, subscription_id, management_key_path) self._sme = ServiceManagementEndpoint(management_cert_path, subscription_id, management_key_path) self.WASMError = WASMError self.get_operation_status = self._sme.get_operation_status self.request_done = self._sme.request_done self.wait_for_request = self._sme.wait_for_request for op in self.service_api.get_wasm_ops(): setattr(self, op.__name__, op) for op in self.storage_api.get_wasm_ops(): setattr(self, op.__name__, op) for op in self.location_api.get_wasm_ops(): setattr(self, op.__name__, op)