diff --git a/azure-mgmt-batchai/MANIFEST.in b/azure-mgmt-batchai/MANIFEST.in index 9ecaeb15de50..6ceb27f7a96e 100644 --- a/azure-mgmt-batchai/MANIFEST.in +++ b/azure-mgmt-batchai/MANIFEST.in @@ -1,2 +1,4 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-batchai/README.rst b/azure-mgmt-batchai/README.rst index d562999e29b7..45de4e6b43dd 100644 --- a/azure-mgmt-batchai/README.rst +++ b/azure-mgmt-batchai/README.rst @@ -1,12 +1,12 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure Batch AI Management Client Library. +This is the Microsoft Azure MyService Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -36,8 +36,8 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `Batch AI Management -`__ +For code examples, see `MyService Management +`__ on docs.microsoft.com. diff --git a/azure-mgmt-batchai/azure/__init__.py b/azure-mgmt-batchai/azure/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-mgmt-batchai/azure/__init__.py +++ b/azure-mgmt-batchai/azure/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-batchai/azure/mgmt/__init__.py b/azure-mgmt-batchai/azure/mgmt/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-mgmt-batchai/azure/mgmt/__init__.py +++ b/azure-mgmt-batchai/azure/mgmt/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/models/job.py b/azure-mgmt-batchai/azure/mgmt/batchai/models/job.py index cdec426d77d7..90d499768a18 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/models/job.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/models/job.py @@ -33,7 +33,7 @@ class Job(ProxyResource): :type cluster: ~azure.mgmt.batchai.models.ResourceId :param mount_volumes: Mount volumes. Collection of mount volumes available to the job during execution. These volumes are mounted before the job - execution and unmouted after the job completion. The volumes are mounted + execution and unmounted after the job completion. The volumes are mounted at location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment variable. :type mount_volumes: ~azure.mgmt.batchai.models.MountVolumes :param node_count: Number of compute nodes to run the job on. The job will @@ -120,7 +120,7 @@ class Job(ProxyResource): up container specified on the job - it does not necessarily mean that the job command line has started executing. terminating - The job is terminated by the user, the terminate operation is in progress. succeeded - - The job has completed running succesfully and exited with exit code 0. + - The job has completed running successfully and exited with exit code 0. failed - The job has finished unsuccessfully (failed with a non-zero exit code) and has exhausted its retry limit. A job is also marked as failed if an error occurred launching the job. Possible values include: 'queued', diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/models/job_create_parameters.py b/azure-mgmt-batchai/azure/mgmt/batchai/models/job_create_parameters.py index 2a2a511f3a4e..cb81edd3d8b6 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/models/job_create_parameters.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/models/job_create_parameters.py @@ -26,8 +26,9 @@ class JobCreateParameters(Model): :type cluster: ~azure.mgmt.batchai.models.ResourceId :param mount_volumes: Mount volumes. Information on mount volumes to be used by the job. These volumes will be mounted before the job execution - and will be unmouted after the job completion. The volumes will be mounted - at location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment variable. + and will be unmounted after the job completion. The volumes will be + mounted at location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment + variable. :type mount_volumes: ~azure.mgmt.batchai.models.MountVolumes :param node_count: Required. Node count. Number of compute nodes to run the job on. The job will be gang scheduled on that many compute nodes. diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/models/job_create_parameters_py3.py b/azure-mgmt-batchai/azure/mgmt/batchai/models/job_create_parameters_py3.py index c8353abbf38c..2d14a4926568 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/models/job_create_parameters_py3.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/models/job_create_parameters_py3.py @@ -26,8 +26,9 @@ class JobCreateParameters(Model): :type cluster: ~azure.mgmt.batchai.models.ResourceId :param mount_volumes: Mount volumes. Information on mount volumes to be used by the job. These volumes will be mounted before the job execution - and will be unmouted after the job completion. The volumes will be mounted - at location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment variable. + and will be unmounted after the job completion. The volumes will be + mounted at location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment + variable. :type mount_volumes: ~azure.mgmt.batchai.models.MountVolumes :param node_count: Required. Node count. Number of compute nodes to run the job on. The job will be gang scheduled on that many compute nodes. diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/models/job_py3.py b/azure-mgmt-batchai/azure/mgmt/batchai/models/job_py3.py index f44c7993df5d..bfd891cc4e51 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/models/job_py3.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/models/job_py3.py @@ -33,7 +33,7 @@ class Job(ProxyResource): :type cluster: ~azure.mgmt.batchai.models.ResourceId :param mount_volumes: Mount volumes. Collection of mount volumes available to the job during execution. These volumes are mounted before the job - execution and unmouted after the job completion. The volumes are mounted + execution and unmounted after the job completion. The volumes are mounted at location specified by $AZ_BATCHAI_JOB_MOUNT_ROOT environment variable. :type mount_volumes: ~azure.mgmt.batchai.models.MountVolumes :param node_count: Number of compute nodes to run the job on. The job will @@ -120,7 +120,7 @@ class Job(ProxyResource): up container specified on the job - it does not necessarily mean that the job command line has started executing. terminating - The job is terminated by the user, the terminate operation is in progress. succeeded - - The job has completed running succesfully and exited with exit code 0. + - The job has completed running successfully and exited with exit code 0. failed - The job has finished unsuccessfully (failed with a non-zero exit code) and has exhausted its retry limit. A job is also marked as failed if an error occurred launching the job. Possible values include: 'queued', diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/models/key_vault_secret_reference.py b/azure-mgmt-batchai/azure/mgmt/batchai/models/key_vault_secret_reference.py index 7b57b69bafd7..d98ec7149ed6 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/models/key_vault_secret_reference.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/models/key_vault_secret_reference.py @@ -18,7 +18,7 @@ class KeyVaultSecretReference(Model): All required parameters must be populated in order to send to Azure. :param source_vault: Required. Key Vault resource identifier. Fully - qualified resource indentifier of the Key Vault. + qualified resource identifier of the Key Vault. :type source_vault: ~azure.mgmt.batchai.models.ResourceId :param secret_url: Required. Secret URL. The URL referencing a secret in the Key Vault. diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/models/key_vault_secret_reference_py3.py b/azure-mgmt-batchai/azure/mgmt/batchai/models/key_vault_secret_reference_py3.py index 06b76be33c1b..b0c0712ac223 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/models/key_vault_secret_reference_py3.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/models/key_vault_secret_reference_py3.py @@ -18,7 +18,7 @@ class KeyVaultSecretReference(Model): All required parameters must be populated in order to send to Azure. :param source_vault: Required. Key Vault resource identifier. Fully - qualified resource indentifier of the Key Vault. + qualified resource identifier of the Key Vault. :type source_vault: ~azure.mgmt.batchai.models.ResourceId :param secret_url: Required. Secret URL. The URL referencing a secret in the Key Vault. diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/models/output_directory.py b/azure-mgmt-batchai/azure/mgmt/batchai/models/output_directory.py index 965d57df2cdc..d904c9186a3d 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/models/output_directory.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/models/output_directory.py @@ -18,7 +18,7 @@ class OutputDirectory(Model): All required parameters must be populated in order to send to Azure. :param id: Required. ID. The ID of the output directory. The job can use - AZ_BATCHAI_OUTPUT_ environment variale to find the directory path, + AZ_BATCHAI_OUTPUT_ environment variable to find the directory path, where is the value of id attribute. :type id: str :param path_prefix: Required. Path prefix. The prefix path where the diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/models/output_directory_py3.py b/azure-mgmt-batchai/azure/mgmt/batchai/models/output_directory_py3.py index fcd6b07caed2..0333bafe00f9 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/models/output_directory_py3.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/models/output_directory_py3.py @@ -18,7 +18,7 @@ class OutputDirectory(Model): All required parameters must be populated in order to send to Azure. :param id: Required. ID. The ID of the output directory. The job can use - AZ_BATCHAI_OUTPUT_ environment variale to find the directory path, + AZ_BATCHAI_OUTPUT_ environment variable to find the directory path, where is the value of id attribute. :type id: str :param path_prefix: Required. Path prefix. The prefix path where the diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/models/unmanaged_file_system_reference.py b/azure-mgmt-batchai/azure/mgmt/batchai/models/unmanaged_file_system_reference.py index 1a821b2dedab..22c9b5ab21e7 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/models/unmanaged_file_system_reference.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/models/unmanaged_file_system_reference.py @@ -13,7 +13,7 @@ class UnmanagedFileSystemReference(Model): - """Unmananged file system mounting configuration. + """Unmanaged file system mounting configuration. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/models/unmanaged_file_system_reference_py3.py b/azure-mgmt-batchai/azure/mgmt/batchai/models/unmanaged_file_system_reference_py3.py index bd98dfe64a5b..23d1058326fb 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/models/unmanaged_file_system_reference_py3.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/models/unmanaged_file_system_reference_py3.py @@ -13,7 +13,7 @@ class UnmanagedFileSystemReference(Model): - """Unmananged file system mounting configuration. + """Unmanaged file system mounting configuration. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/operations/clusters_operations.py b/azure-mgmt-batchai/azure/mgmt/batchai/operations/clusters_operations.py index c769b086314b..9b294f644a50 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/operations/clusters_operations.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/operations/clusters_operations.py @@ -58,6 +58,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -70,9 +71,8 @@ def _create_initial( body_content = self._serialize.body(parameters, 'ClusterCreateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -198,6 +198,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -210,9 +211,8 @@ def update( body_content = self._serialize.body(parameters, 'ClusterUpdateParameters') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -250,7 +250,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -259,8 +258,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -365,7 +364,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -374,8 +373,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -444,7 +443,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -453,9 +452,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -529,7 +527,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -538,9 +536,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/operations/experiments_operations.py b/azure-mgmt-batchai/azure/mgmt/batchai/operations/experiments_operations.py index 135919711e70..172561e3b468 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/operations/experiments_operations.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/operations/experiments_operations.py @@ -93,7 +93,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -102,9 +102,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -143,7 +142,7 @@ def _create_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -152,8 +151,8 @@ def _create_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -247,7 +246,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -256,8 +254,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -362,7 +360,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -371,8 +369,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/operations/file_servers_operations.py b/azure-mgmt-batchai/azure/mgmt/batchai/operations/file_servers_operations.py index e1e7e8db719c..d83b098f01f1 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/operations/file_servers_operations.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/operations/file_servers_operations.py @@ -58,6 +58,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -70,9 +71,8 @@ def _create_initial( body_content = self._serialize.body(parameters, 'FileServerCreateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -170,7 +170,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -179,8 +178,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -285,7 +284,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -294,8 +293,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -368,7 +367,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -377,9 +376,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/operations/jobs_operations.py b/azure-mgmt-batchai/azure/mgmt/batchai/operations/jobs_operations.py index 6d29f0894fd3..9a6c90f8fd27 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/operations/jobs_operations.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/operations/jobs_operations.py @@ -99,7 +99,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -108,9 +108,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -150,6 +149,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -162,9 +162,8 @@ def _create_initial( body_content = self._serialize.body(parameters, 'JobCreateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -268,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -277,8 +275,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -395,7 +393,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -404,8 +402,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -506,7 +504,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -515,9 +513,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -595,7 +592,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -604,9 +601,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -646,7 +642,6 @@ def _terminate_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -655,8 +650,8 @@ def _terminate_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/operations/operations.py b/azure-mgmt-batchai/azure/mgmt/batchai/operations/operations.py index 6d39bdbddf1b..96cabd0ce4e3 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/operations/operations.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/operations/operations.py @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/operations/usages_operations.py b/azure-mgmt-batchai/azure/mgmt/batchai/operations/usages_operations.py index d47c494e5c48..923cbcfae1a5 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/operations/usages_operations.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/operations/usages_operations.py @@ -75,7 +75,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -84,9 +84,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-batchai/azure/mgmt/batchai/operations/workspaces_operations.py b/azure-mgmt-batchai/azure/mgmt/batchai/operations/workspaces_operations.py index 7c6da1d37218..43b0d4a0da3e 100644 --- a/azure-mgmt-batchai/azure/mgmt/batchai/operations/workspaces_operations.py +++ b/azure-mgmt-batchai/azure/mgmt/batchai/operations/workspaces_operations.py @@ -83,7 +83,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -92,9 +92,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -162,7 +161,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -171,9 +170,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -213,6 +211,7 @@ def _create_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -225,9 +224,8 @@ def _create_initial( body_content = self._serialize.body(parameters, 'WorkspaceCreateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: exp = CloudError(response) @@ -346,6 +344,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -358,9 +357,8 @@ def update( body_content = self._serialize.body(parameters, 'WorkspaceUpdateParameters') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -397,7 +395,6 @@ def _delete_initial( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -406,8 +403,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -500,7 +497,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -509,8 +506,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-batchai/azure_bdist_wheel.py b/azure-mgmt-batchai/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b61775..000000000000 --- a/azure-mgmt-batchai/azure_bdist_wheel.py +++ /dev/null @@ -1,54 +0,0 @@ -#------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -#-------------------------------------------------------------------------- - -from distutils import log as logger -import os.path - -from wheel.bdist_wheel import bdist_wheel -class azure_bdist_wheel(bdist_wheel): - """The purpose of this class is to build wheel a little differently than the sdist, - without requiring to build the wheel from the sdist (i.e. you can build the wheel - directly from source). - """ - - description = "Create an Azure wheel distribution" - - user_options = bdist_wheel.user_options + \ - [('azure-namespace-package=', None, - "Name of the deepest nspkg used")] - - def initialize_options(self): - bdist_wheel.initialize_options(self) - self.azure_namespace_package = None - - def finalize_options(self): - bdist_wheel.finalize_options(self) - if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): - raise ValueError("azure_namespace_package must finish by -nspkg") - - def run(self): - if not self.distribution.install_requires: - self.distribution.install_requires = [] - self.distribution.install_requires.append( - "{}>=2.0.0".format(self.azure_namespace_package)) - bdist_wheel.run(self) - - def write_record(self, bdist_dir, distinfo_dir): - if self.azure_namespace_package: - # Split and remove last part, assuming it's "nspkg" - subparts = self.azure_namespace_package.split('-')[0:-1] - folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] - for azure_sub_package in folder_with_init: - init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') - if os.path.isfile(init_file): - logger.info("manually remove {} while building the wheel".format(init_file)) - os.remove(init_file) - else: - raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) - bdist_wheel.write_record(self, bdist_dir, distinfo_dir) -cmdclass = { - 'bdist_wheel': azure_bdist_wheel, -} diff --git a/azure-mgmt-batchai/sdk_packaging.toml b/azure-mgmt-batchai/sdk_packaging.toml new file mode 100644 index 000000000000..2f8a766871cb --- /dev/null +++ b/azure-mgmt-batchai/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-batchai" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-mgmt-batchai/setup.cfg b/azure-mgmt-batchai/setup.cfg index 856f4164982c..3c6e79cf31da 100644 --- a/azure-mgmt-batchai/setup.cfg +++ b/azure-mgmt-batchai/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-mgmt-nspkg \ No newline at end of file diff --git a/azure-mgmt-batchai/setup.py b/azure-mgmt-batchai/setup.py index dbd12ff17775..495633de70ee 100644 --- a/azure-mgmt-batchai/setup.py +++ b/azure-mgmt-batchai/setup.py @@ -10,16 +10,10 @@ import os.path from io import open from setuptools import find_packages, setup -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") - cmdclass = {} # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-batchai" -PACKAGE_PPRINT_NAME = "Batch AI Management" +PACKAGE_PPRINT_NAME = "MyService Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -64,7 +58,7 @@ author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 5 - Production/Stable', + 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'License :: OSI Approved :: MIT License', ], zip_safe=False, - packages=find_packages(exclude=["tests"]), + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), install_requires=[ - 'msrestazure>=0.4.20,<2.0.0', + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } )