diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/_meta.json b/sdk/machinelearning/azure-mgmt-guestconfig/_meta.json index acfcecc0577c0..0e5468c7916c1 100644 --- a/sdk/machinelearning/azure-mgmt-guestconfig/_meta.json +++ b/sdk/machinelearning/azure-mgmt-guestconfig/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.2", + "autorest": "3.4.5", "use": [ - "@autorest/python@5.8.1", + "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "33b8d6f7bf2eb081fe134333b0fc445777e488d6", + "commit": "3d1c5d45f465ee873b46edacd52d045cf75cb7c3", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/guestconfiguration/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "autorest_command": "autorest specification/guestconfiguration/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/guestconfiguration/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_assignments_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_assignments_operations.py index cd28e6abc4d23..1de1f3b2d4c08 100644 --- a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_assignments_operations.py +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/aio/operations/_guest_configuration_assignments_operations.py @@ -239,6 +239,144 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + def subscription_list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.GuestConfigurationAssignmentList"]: + """List all guest configuration assignments for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GuestConfigurationAssignmentList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentListor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.subscription_list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GuestConfigurationAssignmentList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + subscription_list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments'} # type: ignore + + def rg_list( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.GuestConfigurationAssignmentList"]: + """List all guest configuration assignments for a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GuestConfigurationAssignmentList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentListor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.rg_list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GuestConfigurationAssignmentList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + rg_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments'} # type: ignore + def list( self, resource_group_name: str, diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/__init__.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/__init__.py index 1fbc819ce4c0b..827c1a145522d 100644 --- a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/__init__.py +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/__init__.py @@ -30,6 +30,7 @@ from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import VMInfo + from ._models_py3 import VMSSVMInfo except (SyntaxError, ImportError): from ._models import AssignmentInfo # type: ignore from ._models import AssignmentReport # type: ignore @@ -54,6 +55,7 @@ from ._models import ProxyResource # type: ignore from ._models import Resource # type: ignore from ._models import VMInfo # type: ignore + from ._models import VMSSVMInfo # type: ignore from ._guest_configuration_client_enums import ( ActionAfterReboot, @@ -89,6 +91,7 @@ 'ProxyResource', 'Resource', 'VMInfo', + 'VMSSVMInfo', 'ActionAfterReboot', 'AssignmentType', 'ComplianceStatus', diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models.py index b3a277e772d4d..7cd8f2873fbb0 100644 --- a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models.py +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models.py @@ -524,6 +524,12 @@ class GuestConfigurationAssignmentProperties(msrest.serialization.Model): :vartype last_compliance_status_checked: ~datetime.datetime :ivar latest_report_id: Id of the latest report for the guest configuration assignment. :vartype latest_report_id: str + :ivar parameter_hash: parameter hash for the guest configuration assignment. + :vartype parameter_hash: str + :ivar resource_type: Type of the resource - VMSS / VM. + :vartype resource_type: str + :param vmss_vm_list: The list of VM Compliance data for VMSS. + :type vmss_vm_list: list[~azure.mgmt.guestconfig.models.VMSSVMInfo] :param latest_assignment_report: Last reported guest configuration assignment report. :type latest_assignment_report: ~azure.mgmt.guestconfig.models.AssignmentReport :param context: The source which initiated the guest configuration assignment. Ex: Azure @@ -541,6 +547,8 @@ class GuestConfigurationAssignmentProperties(msrest.serialization.Model): 'compliance_status': {'readonly': True}, 'last_compliance_status_checked': {'readonly': True}, 'latest_report_id': {'readonly': True}, + 'parameter_hash': {'readonly': True}, + 'resource_type': {'readonly': True}, 'assignment_hash': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -551,6 +559,9 @@ class GuestConfigurationAssignmentProperties(msrest.serialization.Model): 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, 'last_compliance_status_checked': {'key': 'lastComplianceStatusChecked', 'type': 'iso-8601'}, 'latest_report_id': {'key': 'latestReportId', 'type': 'str'}, + 'parameter_hash': {'key': 'parameterHash', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'vmss_vm_list': {'key': 'vmssVMList', 'type': '[VMSSVMInfo]'}, 'latest_assignment_report': {'key': 'latestAssignmentReport', 'type': 'AssignmentReport'}, 'context': {'key': 'context', 'type': 'str'}, 'assignment_hash': {'key': 'assignmentHash', 'type': 'str'}, @@ -567,6 +578,9 @@ def __init__( self.compliance_status = None self.last_compliance_status_checked = None self.latest_report_id = None + self.parameter_hash = None + self.resource_type = None + self.vmss_vm_list = kwargs.get('vmss_vm_list', None) self.latest_assignment_report = kwargs.get('latest_assignment_report', None) self.context = kwargs.get('context', None) self.assignment_hash = None @@ -651,6 +665,8 @@ class GuestConfigurationAssignmentReportProperties(msrest.serialization.Model): :vartype end_time: ~datetime.datetime :param details: Details of the assignment report. :type details: ~azure.mgmt.guestconfig.models.AssignmentReportDetails + :ivar vmss_resource_id: Azure resource Id of the VMSS. + :vartype vmss_resource_id: str """ _validation = { @@ -658,6 +674,7 @@ class GuestConfigurationAssignmentReportProperties(msrest.serialization.Model): 'report_id': {'readonly': True}, 'start_time': {'readonly': True}, 'end_time': {'readonly': True}, + 'vmss_resource_id': {'readonly': True}, } _attribute_map = { @@ -668,6 +685,7 @@ class GuestConfigurationAssignmentReportProperties(msrest.serialization.Model): 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, 'details': {'key': 'details', 'type': 'AssignmentReportDetails'}, + 'vmss_resource_id': {'key': 'vmssResourceId', 'type': 'str'}, } def __init__( @@ -682,11 +700,14 @@ def __init__( self.start_time = None self.end_time = None self.details = kwargs.get('details', None) + self.vmss_resource_id = None class GuestConfigurationNavigation(msrest.serialization.Model): """Guest configuration is an artifact that encapsulates DSC configuration and its dependencies. The artifact is a zip file containing DSC configuration (as MOF) and dependent resources and other dependencies like modules. + Variables are only populated by the server, and will be ignored when sending a request. + :param kind: Kind of the guest configuration. For example:DSC. Possible values include: "DSC". :type kind: str or ~azure.mgmt.guestconfig.models.Kind :param name: Name of the guest configuration. @@ -703,12 +724,23 @@ class GuestConfigurationNavigation(msrest.serialization.Model): Possible values include: "Audit", "DeployAndAutoCorrect", "ApplyAndAutoCorrect", "ApplyAndMonitor". :type assignment_type: str or ~azure.mgmt.guestconfig.models.AssignmentType + :ivar content_type: Specifies the content type of the configuration. Possible values could be + Builtin or Custom. + :vartype content_type: str :param configuration_parameter: The configuration parameters for the guest configuration. :type configuration_parameter: list[~azure.mgmt.guestconfig.models.ConfigurationParameter] + :param configuration_protected_parameter: The protected configuration parameters for the guest + configuration. + :type configuration_protected_parameter: + list[~azure.mgmt.guestconfig.models.ConfigurationParameter] :param configuration_setting: The configuration setting for the guest configuration. :type configuration_setting: ~azure.mgmt.guestconfig.models.ConfigurationSetting """ + _validation = { + 'content_type': {'readonly': True}, + } + _attribute_map = { 'kind': {'key': 'kind', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, @@ -716,7 +748,9 @@ class GuestConfigurationNavigation(msrest.serialization.Model): 'content_uri': {'key': 'contentUri', 'type': 'str'}, 'content_hash': {'key': 'contentHash', 'type': 'str'}, 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, 'configuration_parameter': {'key': 'configurationParameter', 'type': '[ConfigurationParameter]'}, + 'configuration_protected_parameter': {'key': 'configurationProtectedParameter', 'type': '[ConfigurationParameter]'}, 'configuration_setting': {'key': 'configurationSetting', 'type': 'ConfigurationSetting'}, } @@ -731,7 +765,9 @@ def __init__( self.content_uri = kwargs.get('content_uri', None) self.content_hash = kwargs.get('content_hash', None) self.assignment_type = kwargs.get('assignment_type', None) + self.content_type = None self.configuration_parameter = kwargs.get('configuration_parameter', None) + self.configuration_protected_parameter = kwargs.get('configuration_protected_parameter', None) self.configuration_setting = kwargs.get('configuration_setting', None) @@ -841,3 +877,49 @@ def __init__( super(VMInfo, self).__init__(**kwargs) self.id = None self.uuid = None + + +class VMSSVMInfo(msrest.serialization.Model): + """Information about VMSS VM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vm_id: UUID of the VM. + :vartype vm_id: str + :ivar vm_resource_id: Azure resource Id of the VM. + :vartype vm_resource_id: str + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar latest_report_id: Id of the latest report for the guest configuration assignment. + :vartype latest_report_id: str + :ivar last_compliance_checked: Date and time when last compliance status was checked. + :vartype last_compliance_checked: ~datetime.datetime + """ + + _validation = { + 'vm_id': {'readonly': True}, + 'vm_resource_id': {'readonly': True}, + 'compliance_status': {'readonly': True}, + 'latest_report_id': {'readonly': True}, + 'last_compliance_checked': {'readonly': True}, + } + + _attribute_map = { + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'latest_report_id': {'key': 'latestReportId', 'type': 'str'}, + 'last_compliance_checked': {'key': 'lastComplianceChecked', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(VMSSVMInfo, self).__init__(**kwargs) + self.vm_id = None + self.vm_resource_id = None + self.compliance_status = None + self.latest_report_id = None + self.last_compliance_checked = None diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models_py3.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models_py3.py index bce6b19cdec6f..6085ce0172e4a 100644 --- a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models_py3.py +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/models/_models_py3.py @@ -565,6 +565,12 @@ class GuestConfigurationAssignmentProperties(msrest.serialization.Model): :vartype last_compliance_status_checked: ~datetime.datetime :ivar latest_report_id: Id of the latest report for the guest configuration assignment. :vartype latest_report_id: str + :ivar parameter_hash: parameter hash for the guest configuration assignment. + :vartype parameter_hash: str + :ivar resource_type: Type of the resource - VMSS / VM. + :vartype resource_type: str + :param vmss_vm_list: The list of VM Compliance data for VMSS. + :type vmss_vm_list: list[~azure.mgmt.guestconfig.models.VMSSVMInfo] :param latest_assignment_report: Last reported guest configuration assignment report. :type latest_assignment_report: ~azure.mgmt.guestconfig.models.AssignmentReport :param context: The source which initiated the guest configuration assignment. Ex: Azure @@ -582,6 +588,8 @@ class GuestConfigurationAssignmentProperties(msrest.serialization.Model): 'compliance_status': {'readonly': True}, 'last_compliance_status_checked': {'readonly': True}, 'latest_report_id': {'readonly': True}, + 'parameter_hash': {'readonly': True}, + 'resource_type': {'readonly': True}, 'assignment_hash': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -592,6 +600,9 @@ class GuestConfigurationAssignmentProperties(msrest.serialization.Model): 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, 'last_compliance_status_checked': {'key': 'lastComplianceStatusChecked', 'type': 'iso-8601'}, 'latest_report_id': {'key': 'latestReportId', 'type': 'str'}, + 'parameter_hash': {'key': 'parameterHash', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'vmss_vm_list': {'key': 'vmssVMList', 'type': '[VMSSVMInfo]'}, 'latest_assignment_report': {'key': 'latestAssignmentReport', 'type': 'AssignmentReport'}, 'context': {'key': 'context', 'type': 'str'}, 'assignment_hash': {'key': 'assignmentHash', 'type': 'str'}, @@ -602,6 +613,7 @@ def __init__( self, *, guest_configuration: Optional["GuestConfigurationNavigation"] = None, + vmss_vm_list: Optional[List["VMSSVMInfo"]] = None, latest_assignment_report: Optional["AssignmentReport"] = None, context: Optional[str] = None, **kwargs @@ -612,6 +624,9 @@ def __init__( self.compliance_status = None self.last_compliance_status_checked = None self.latest_report_id = None + self.parameter_hash = None + self.resource_type = None + self.vmss_vm_list = vmss_vm_list self.latest_assignment_report = latest_assignment_report self.context = context self.assignment_hash = None @@ -700,6 +715,8 @@ class GuestConfigurationAssignmentReportProperties(msrest.serialization.Model): :vartype end_time: ~datetime.datetime :param details: Details of the assignment report. :type details: ~azure.mgmt.guestconfig.models.AssignmentReportDetails + :ivar vmss_resource_id: Azure resource Id of the VMSS. + :vartype vmss_resource_id: str """ _validation = { @@ -707,6 +724,7 @@ class GuestConfigurationAssignmentReportProperties(msrest.serialization.Model): 'report_id': {'readonly': True}, 'start_time': {'readonly': True}, 'end_time': {'readonly': True}, + 'vmss_resource_id': {'readonly': True}, } _attribute_map = { @@ -717,6 +735,7 @@ class GuestConfigurationAssignmentReportProperties(msrest.serialization.Model): 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, 'details': {'key': 'details', 'type': 'AssignmentReportDetails'}, + 'vmss_resource_id': {'key': 'vmssResourceId', 'type': 'str'}, } def __init__( @@ -735,11 +754,14 @@ def __init__( self.start_time = None self.end_time = None self.details = details + self.vmss_resource_id = None class GuestConfigurationNavigation(msrest.serialization.Model): """Guest configuration is an artifact that encapsulates DSC configuration and its dependencies. The artifact is a zip file containing DSC configuration (as MOF) and dependent resources and other dependencies like modules. + Variables are only populated by the server, and will be ignored when sending a request. + :param kind: Kind of the guest configuration. For example:DSC. Possible values include: "DSC". :type kind: str or ~azure.mgmt.guestconfig.models.Kind :param name: Name of the guest configuration. @@ -756,12 +778,23 @@ class GuestConfigurationNavigation(msrest.serialization.Model): Possible values include: "Audit", "DeployAndAutoCorrect", "ApplyAndAutoCorrect", "ApplyAndMonitor". :type assignment_type: str or ~azure.mgmt.guestconfig.models.AssignmentType + :ivar content_type: Specifies the content type of the configuration. Possible values could be + Builtin or Custom. + :vartype content_type: str :param configuration_parameter: The configuration parameters for the guest configuration. :type configuration_parameter: list[~azure.mgmt.guestconfig.models.ConfigurationParameter] + :param configuration_protected_parameter: The protected configuration parameters for the guest + configuration. + :type configuration_protected_parameter: + list[~azure.mgmt.guestconfig.models.ConfigurationParameter] :param configuration_setting: The configuration setting for the guest configuration. :type configuration_setting: ~azure.mgmt.guestconfig.models.ConfigurationSetting """ + _validation = { + 'content_type': {'readonly': True}, + } + _attribute_map = { 'kind': {'key': 'kind', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, @@ -769,7 +802,9 @@ class GuestConfigurationNavigation(msrest.serialization.Model): 'content_uri': {'key': 'contentUri', 'type': 'str'}, 'content_hash': {'key': 'contentHash', 'type': 'str'}, 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, 'configuration_parameter': {'key': 'configurationParameter', 'type': '[ConfigurationParameter]'}, + 'configuration_protected_parameter': {'key': 'configurationProtectedParameter', 'type': '[ConfigurationParameter]'}, 'configuration_setting': {'key': 'configurationSetting', 'type': 'ConfigurationSetting'}, } @@ -783,6 +818,7 @@ def __init__( content_hash: Optional[str] = None, assignment_type: Optional[Union[str, "AssignmentType"]] = None, configuration_parameter: Optional[List["ConfigurationParameter"]] = None, + configuration_protected_parameter: Optional[List["ConfigurationParameter"]] = None, configuration_setting: Optional["ConfigurationSetting"] = None, **kwargs ): @@ -793,7 +829,9 @@ def __init__( self.content_uri = content_uri self.content_hash = content_hash self.assignment_type = assignment_type + self.content_type = None self.configuration_parameter = configuration_parameter + self.configuration_protected_parameter = configuration_protected_parameter self.configuration_setting = configuration_setting @@ -914,3 +952,49 @@ def __init__( super(VMInfo, self).__init__(**kwargs) self.id = None self.uuid = None + + +class VMSSVMInfo(msrest.serialization.Model): + """Information about VMSS VM. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vm_id: UUID of the VM. + :vartype vm_id: str + :ivar vm_resource_id: Azure resource Id of the VM. + :vartype vm_resource_id: str + :ivar compliance_status: A value indicating compliance status of the machine for the assigned + guest configuration. Possible values include: "Compliant", "NonCompliant", "Pending". + :vartype compliance_status: str or ~azure.mgmt.guestconfig.models.ComplianceStatus + :ivar latest_report_id: Id of the latest report for the guest configuration assignment. + :vartype latest_report_id: str + :ivar last_compliance_checked: Date and time when last compliance status was checked. + :vartype last_compliance_checked: ~datetime.datetime + """ + + _validation = { + 'vm_id': {'readonly': True}, + 'vm_resource_id': {'readonly': True}, + 'compliance_status': {'readonly': True}, + 'latest_report_id': {'readonly': True}, + 'last_compliance_checked': {'readonly': True}, + } + + _attribute_map = { + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + 'compliance_status': {'key': 'complianceStatus', 'type': 'str'}, + 'latest_report_id': {'key': 'latestReportId', 'type': 'str'}, + 'last_compliance_checked': {'key': 'lastComplianceChecked', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(VMSSVMInfo, self).__init__(**kwargs) + self.vm_id = None + self.vm_resource_id = None + self.compliance_status = None + self.latest_report_id = None + self.last_compliance_checked = None diff --git a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_assignments_operations.py b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_assignments_operations.py index f518307777cdf..8d3b1ceaaba99 100644 --- a/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_assignments_operations.py +++ b/sdk/machinelearning/azure-mgmt-guestconfig/azure/mgmt/guestconfig/operations/_guest_configuration_assignments_operations.py @@ -246,6 +246,146 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}'} # type: ignore + def subscription_list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GuestConfigurationAssignmentList"] + """List all guest configuration assignments for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GuestConfigurationAssignmentList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentListor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.subscription_list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('GuestConfigurationAssignmentList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + subscription_list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments'} # type: ignore + + def rg_list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GuestConfigurationAssignmentList"] + """List all guest configuration assignments for a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GuestConfigurationAssignmentList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.guestconfig.models.GuestConfigurationAssignmentListor None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestConfigurationAssignmentList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-25" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.rg_list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('GuestConfigurationAssignmentList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + rg_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments'} # type: ignore + def list( self, resource_group_name, # type: str