Skip to content

Commit

Permalink
CodeGen from PR 16902 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge c7144760e2fddd0b9328f113cff6a03b2a8c8987 into b22180c
  • Loading branch information
SDKAuto committed Nov 30, 2021
1 parent d769535 commit a9b518d
Show file tree
Hide file tree
Showing 6 changed files with 451 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sdk/machinelearning/azure-mgmt-guestconfig/_meta.json
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -89,6 +91,7 @@
'ProxyResource',
'Resource',
'VMInfo',
'VMSSVMInfo',
'ActionAfterReboot',
'AssignmentType',
'ComplianceStatus',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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},
}
Expand All @@ -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'},
Expand All @@ -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
Expand Down Expand Up @@ -651,13 +665,16 @@ 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 = {
'compliance_status': {'readonly': True},
'report_id': {'readonly': True},
'start_time': {'readonly': True},
'end_time': {'readonly': True},
'vmss_resource_id': {'readonly': True},
}

_attribute_map = {
Expand All @@ -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__(
Expand All @@ -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.
Expand All @@ -703,20 +724,33 @@ 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'},
'version': {'key': 'version', 'type': 'str'},
'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'},
}

Expand All @@ -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)


Expand Down Expand Up @@ -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
Loading

0 comments on commit a9b518d

Please sign in to comment.