Skip to content

Commit

Permalink
Generated from 952787113782496f2c1f21d03f19db360bed5cee
Browse files Browse the repository at this point in the history
  • Loading branch information
SDK Automation committed Oct 19, 2020
1 parent 62d6a81 commit 58e8bc6
Show file tree
Hide file tree
Showing 13 changed files with 1,519 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class ComputeManagementClient(MultiApiClientMixin, SDKClient):
'virtual_machine_scale_set_extensions': '2020-06-01',
'virtual_machine_scale_set_rolling_upgrades': '2020-06-01',
'virtual_machine_scale_set_vm_extensions': '2020-06-01',
'virtual_machine_scale_set_vm_run_commands': '2020-06-01',
'virtual_machine_scale_set_vms': '2020-06-01',
'virtual_machine_scale_sets': '2020-06-01',
'virtual_machine_sizes': '2020-06-01',
Expand Down Expand Up @@ -1043,6 +1044,19 @@ def virtual_machine_scale_set_vm_extensions(self):
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def virtual_machine_scale_set_vm_run_commands(self):
"""Instance depends on the API version:
* 2020-06-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations<azure.mgmt.compute.v2020_06_01.operations.VirtualMachineScaleSetVMRunCommandsOperations>`
"""
api_version = self._get_api_version('virtual_machine_scale_set_vm_run_commands')
if api_version == '2020-06-01':
from .v2020_06_01.operations import VirtualMachineScaleSetVMRunCommandsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def virtual_machine_scale_set_vms(self):
"""Instance depends on the API version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from .operations import VirtualMachineScaleSetVMsOperations
from .operations import LogAnalyticsOperations
from .operations import VirtualMachineRunCommandsOperations
from .operations import VirtualMachineScaleSetVMRunCommandsOperations
from . import models


Expand Down Expand Up @@ -82,6 +83,8 @@ class ComputeManagementClient(SDKClient):
:vartype log_analytics: azure.mgmt.compute.v2020_06_01.operations.LogAnalyticsOperations
:ivar virtual_machine_run_commands: VirtualMachineRunCommands operations
:vartype virtual_machine_run_commands: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineRunCommandsOperations
:ivar virtual_machine_scale_set_vm_run_commands: VirtualMachineScaleSetVMRunCommands operations
:vartype virtual_machine_scale_set_vm_run_commands: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineScaleSetVMRunCommandsOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand Down Expand Up @@ -144,3 +147,5 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.virtual_machine_run_commands = VirtualMachineRunCommandsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.virtual_machine_scale_set_vm_run_commands = VirtualMachineScaleSetVMRunCommandsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@
from ._models_py3 import VirtualMachineInstanceView
from ._models_py3 import VirtualMachinePatchStatus
from ._models_py3 import VirtualMachineReimageParameters
from ._models_py3 import VirtualMachineRunCommand
from ._models_py3 import VirtualMachineRunCommandInstanceView
from ._models_py3 import VirtualMachineRunCommandScriptSource
from ._models_py3 import VirtualMachineRunCommandUpdate
from ._models_py3 import VirtualMachineScaleSet
from ._models_py3 import VirtualMachineScaleSetDataDisk
from ._models_py3 import VirtualMachineScaleSetExtension
Expand Down Expand Up @@ -304,6 +308,10 @@
from ._models import VirtualMachineInstanceView
from ._models import VirtualMachinePatchStatus
from ._models import VirtualMachineReimageParameters
from ._models import VirtualMachineRunCommand
from ._models import VirtualMachineRunCommandInstanceView
from ._models import VirtualMachineRunCommandScriptSource
from ._models import VirtualMachineRunCommandUpdate
from ._models import VirtualMachineScaleSet
from ._models import VirtualMachineScaleSetDataDisk
from ._models import VirtualMachineScaleSetExtension
Expand Down Expand Up @@ -364,6 +372,7 @@
from ._paged_models import UpgradeOperationHistoricalStatusInfoPaged
from ._paged_models import UsagePaged
from ._paged_models import VirtualMachinePaged
from ._paged_models import VirtualMachineRunCommandPaged
from ._paged_models import VirtualMachineScaleSetExtensionPaged
from ._paged_models import VirtualMachineScaleSetPaged
from ._paged_models import VirtualMachineScaleSetSkuPaged
Expand Down Expand Up @@ -410,6 +419,7 @@
RollingUpgradeActionType,
IntervalInMins,
OrchestrationServiceStateAction,
ExecutionState,
InstanceViewTypes,
)

Expand Down Expand Up @@ -536,6 +546,10 @@
'VirtualMachineInstanceView',
'VirtualMachinePatchStatus',
'VirtualMachineReimageParameters',
'VirtualMachineRunCommand',
'VirtualMachineRunCommandInstanceView',
'VirtualMachineRunCommandScriptSource',
'VirtualMachineRunCommandUpdate',
'VirtualMachineScaleSet',
'VirtualMachineScaleSetDataDisk',
'VirtualMachineScaleSetExtension',
Expand Down Expand Up @@ -601,6 +615,7 @@
'VirtualMachineScaleSetExtensionPaged',
'VirtualMachineScaleSetVMPaged',
'RunCommandDocumentBasePaged',
'VirtualMachineRunCommandPaged',
'VmDiskTypes',
'HyperVGenerationTypes',
'StatusLevelTypes',
Expand Down Expand Up @@ -641,5 +656,6 @@
'RollingUpgradeActionType',
'IntervalInMins',
'OrchestrationServiceStateAction',
'ExecutionState',
'InstanceViewTypes',
]
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,17 @@ class OrchestrationServiceStateAction(str, Enum):
suspend = "Suspend"


class ExecutionState(str, Enum):

unknown = "Unknown"
pending = "Pending"
running = "Running"
failed = "Failed"
succeeded = "Succeeded"
timed_out = "TimedOut"
canceled = "Canceled"


class InstanceViewTypes(str, Enum):

instance_view = "instanceView"
Original file line number Diff line number Diff line change
Expand Up @@ -5033,6 +5033,255 @@ def __init__(self, **kwargs):
self.temp_disk = kwargs.get('temp_disk', None)


class VirtualMachineRunCommand(Resource):
"""Describes a Virtual Machine run command.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource Id
:vartype id: str
:ivar name: Resource name
:vartype name: str
:ivar type: Resource type
:vartype type: str
:param location: Required. Resource location
:type location: str
:param tags: Resource tags
:type tags: dict[str, str]
:param source: The source of the run command script.
:type source:
~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandScriptSource
:param parameters: The parameters used by the script.
:type parameters:
list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter]
:param protected_parameters: The parameters used by the script.
:type protected_parameters:
list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter]
:param async_execution: Optional. If set to true, provisioning will
complete as soon as the script starts and will not wait for script to
complete. Default value: False .
:type async_execution: bool
:param run_as_user: Specifies the user account on the VM when executing
the run command.
:type run_as_user: str
:param run_as_password: Specifies the user account password on the VM when
executing the run command.
:type run_as_password: str
:param timeout_in_seconds: The timeout in seconds to execute the run
command.
:type timeout_in_seconds: int
:param output_blob_uri: Specifies the Azure storage blob where script
output stream will be uploaded.
:type output_blob_uri: str
:param error_blob_uri: Specifies the Azure storage blob where script error
stream will be uploaded.
:type error_blob_uri: str
:ivar provisioning_state: The provisioning state, which only appears in
the response.
:vartype provisioning_state: str
:ivar instance_view: The virtual machine run command instance view.
:vartype instance_view:
~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandInstanceView
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'provisioning_state': {'readonly': True},
'instance_view': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'source': {'key': 'properties.source', 'type': 'VirtualMachineRunCommandScriptSource'},
'parameters': {'key': 'properties.parameters', 'type': '[RunCommandInputParameter]'},
'protected_parameters': {'key': 'properties.protectedParameters', 'type': '[RunCommandInputParameter]'},
'async_execution': {'key': 'properties.asyncExecution', 'type': 'bool'},
'run_as_user': {'key': 'properties.runAsUser', 'type': 'str'},
'run_as_password': {'key': 'properties.runAsPassword', 'type': 'str'},
'timeout_in_seconds': {'key': 'properties.timeoutInSeconds', 'type': 'int'},
'output_blob_uri': {'key': 'properties.outputBlobUri', 'type': 'str'},
'error_blob_uri': {'key': 'properties.errorBlobUri', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineRunCommandInstanceView'},
}

def __init__(self, **kwargs):
super(VirtualMachineRunCommand, self).__init__(**kwargs)
self.source = kwargs.get('source', None)
self.parameters = kwargs.get('parameters', None)
self.protected_parameters = kwargs.get('protected_parameters', None)
self.async_execution = kwargs.get('async_execution', False)
self.run_as_user = kwargs.get('run_as_user', None)
self.run_as_password = kwargs.get('run_as_password', None)
self.timeout_in_seconds = kwargs.get('timeout_in_seconds', None)
self.output_blob_uri = kwargs.get('output_blob_uri', None)
self.error_blob_uri = kwargs.get('error_blob_uri', None)
self.provisioning_state = None
self.instance_view = None


class VirtualMachineRunCommandInstanceView(Model):
"""The instance view of a virtual machine run command.
:param execution_state: Script execution status. Possible values include:
'Unknown', 'Pending', 'Running', 'Failed', 'Succeeded', 'TimedOut',
'Canceled'
:type execution_state: str or
~azure.mgmt.compute.v2020_06_01.models.ExecutionState
:param execution_message: Communicate script configuration errors or
execution messages.
:type execution_message: str
:param exit_code: Exit code returned from script execution.
:type exit_code: int
:param output: Script output stream.
:type output: str
:param error: Script error stream.
:type error: str
:param start_time: Script start time.
:type start_time: datetime
:param end_time: Script end time.
:type end_time: datetime
:param statuses: The resource status information.
:type statuses:
list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus]
"""

_attribute_map = {
'execution_state': {'key': 'executionState', 'type': 'str'},
'execution_message': {'key': 'executionMessage', 'type': 'str'},
'exit_code': {'key': 'exitCode', 'type': 'int'},
'output': {'key': 'output', 'type': 'str'},
'error': {'key': 'error', 'type': 'str'},
'start_time': {'key': 'startTime', 'type': 'iso-8601'},
'end_time': {'key': 'endTime', 'type': 'iso-8601'},
'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'},
}

def __init__(self, **kwargs):
super(VirtualMachineRunCommandInstanceView, self).__init__(**kwargs)
self.execution_state = kwargs.get('execution_state', None)
self.execution_message = kwargs.get('execution_message', None)
self.exit_code = kwargs.get('exit_code', None)
self.output = kwargs.get('output', None)
self.error = kwargs.get('error', None)
self.start_time = kwargs.get('start_time', None)
self.end_time = kwargs.get('end_time', None)
self.statuses = kwargs.get('statuses', None)


class VirtualMachineRunCommandScriptSource(Model):
"""Describes the script sources for run command.
:param script: Specifies the script content to be executed on the VM.
:type script: str
:param script_uri: Specifies the script download location.
:type script_uri: str
:param command_id: Specifies a commandId of predefined built-in script.
:type command_id: str
"""

_attribute_map = {
'script': {'key': 'script', 'type': 'str'},
'script_uri': {'key': 'scriptUri', 'type': 'str'},
'command_id': {'key': 'commandId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(VirtualMachineRunCommandScriptSource, self).__init__(**kwargs)
self.script = kwargs.get('script', None)
self.script_uri = kwargs.get('script_uri', None)
self.command_id = kwargs.get('command_id', None)


class VirtualMachineRunCommandUpdate(UpdateResource):
"""Describes a Virtual Machine run command.
Variables are only populated by the server, and will be ignored when
sending a request.
:param tags: Resource tags
:type tags: dict[str, str]
:param source: The source of the run command script.
:type source:
~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandScriptSource
:param parameters: The parameters used by the script.
:type parameters:
list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter]
:param protected_parameters: The parameters used by the script.
:type protected_parameters:
list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter]
:param async_execution: Optional. If set to true, provisioning will
complete as soon as the script starts and will not wait for script to
complete. Default value: False .
:type async_execution: bool
:param run_as_user: Specifies the user account on the VM when executing
the run command.
:type run_as_user: str
:param run_as_password: Specifies the user account password on the VM when
executing the run command.
:type run_as_password: str
:param timeout_in_seconds: The timeout in seconds to execute the run
command.
:type timeout_in_seconds: int
:param output_blob_uri: Specifies the Azure storage blob where script
output stream will be uploaded.
:type output_blob_uri: str
:param error_blob_uri: Specifies the Azure storage blob where script error
stream will be uploaded.
:type error_blob_uri: str
:ivar provisioning_state: The provisioning state, which only appears in
the response.
:vartype provisioning_state: str
:ivar instance_view: The virtual machine run command instance view.
:vartype instance_view:
~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandInstanceView
"""

_validation = {
'provisioning_state': {'readonly': True},
'instance_view': {'readonly': True},
}

_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'source': {'key': 'properties.source', 'type': 'VirtualMachineRunCommandScriptSource'},
'parameters': {'key': 'properties.parameters', 'type': '[RunCommandInputParameter]'},
'protected_parameters': {'key': 'properties.protectedParameters', 'type': '[RunCommandInputParameter]'},
'async_execution': {'key': 'properties.asyncExecution', 'type': 'bool'},
'run_as_user': {'key': 'properties.runAsUser', 'type': 'str'},
'run_as_password': {'key': 'properties.runAsPassword', 'type': 'str'},
'timeout_in_seconds': {'key': 'properties.timeoutInSeconds', 'type': 'int'},
'output_blob_uri': {'key': 'properties.outputBlobUri', 'type': 'str'},
'error_blob_uri': {'key': 'properties.errorBlobUri', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineRunCommandInstanceView'},
}

def __init__(self, **kwargs):
super(VirtualMachineRunCommandUpdate, self).__init__(**kwargs)
self.source = kwargs.get('source', None)
self.parameters = kwargs.get('parameters', None)
self.protected_parameters = kwargs.get('protected_parameters', None)
self.async_execution = kwargs.get('async_execution', False)
self.run_as_user = kwargs.get('run_as_user', None)
self.run_as_password = kwargs.get('run_as_password', None)
self.timeout_in_seconds = kwargs.get('timeout_in_seconds', None)
self.output_blob_uri = kwargs.get('output_blob_uri', None)
self.error_blob_uri = kwargs.get('error_blob_uri', None)
self.provisioning_state = None
self.instance_view = None


class VirtualMachineScaleSet(Resource):
"""Describes a Virtual Machine Scale Set.
Expand Down
Loading

0 comments on commit 58e8bc6

Please sign in to comment.