there is a bug in getting the command to load, but this is most of the framework

This commit is contained in:
Page Bowers 2020-09-09 12:12:20 -07:00
Родитель c32e7d87f4
Коммит 3c14abfd3d
50 изменённых файлов: 2628 добавлений и 0 удалений

0
HISTORY.rst Normal file
Просмотреть файл

5
README.rst Normal file
Просмотреть файл

@ -0,0 +1,5 @@
Microsoft Azure CLI 'azurebaremetal' Command Module for BareMetalInfrastructure
==============================================================================
This package is for the 'azurebaremetal' module.
i.e. 'az azurebaremetal'

Просмотреть файл

@ -0,0 +1,28 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from azure.cli.core import AzCommandsLoader
import azext_baremetalinfrastructure._help # pylint: disable=unused-import
class AzureBareMetalInstanceCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
custom_type = CliCommandType(operations_tmpl='azext_baremetalinfrastructure.custom#{}')
super(AzureBareMetalInstanceCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=custom_type,
min_profile='2017-03-10-profile')
def load_command_table(self, args):
from azext_baremetalinfrastructure.commands import load_command_table
load_command_table(self, args)
return self.command_table
def load_arguments(self, command):
from azext_baremetalinfrastructure._params import load_arguments
load_arguments(self, command)
COMMAND_LOADER_CLS = AzureBareMetalInstanceCommandsLoader

Просмотреть файл

@ -0,0 +1,12 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
def _azurebaremetal_instance_client_factory(cli_ctx, *_):
from azext_baremetalinfrastructure.modules_sdk import BareMetalInfrastructurelManagementClient
from azure.cli.core.commands.client_factory import get_mgmt_service_client
return get_mgmt_service_client(cli_ctx, BareMetalManagementClient)
def cf_azurebaremetalinstance_groups(cli_ctx, *_):
return _azurebaremetal_instance_client_factory(cli_ctx).baremetal_instances

Просмотреть файл

@ -0,0 +1,22 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long
from knack.help_files import helps
helps['azurebaremetalinstance'] = """
type: group
short-summary: (PREVIEW) Manage Azure Bare Metal Instance.
"""
helps['azurebaremetalinstance show'] = """
type: command
short-summary: Get the details of an Azure Bare Metal Instance.
"""
helps['azurebaremetalinstance list'] = """
type: command
short-summary: List Azure Bare Metal Instances.
"""

Просмотреть файл

@ -0,0 +1,14 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long
from azure.cli.core.commands.parameters import resource_group_name_type
def load_arguments(self, _):
with self.argument_context('azurebaremetalinstance') as c:
c.argument('resource_group_name', arg_type=resource_group_name_type)
c.argument('instance_name', options_list=['--instance-name', '-n'], help="The name of the Azure Bare Metal instance", id_part='name')

Просмотреть файл

@ -0,0 +1,15 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long
from azure.cli.core.util import empty_on_404
from ._client_factory import cf_azurebaremetalinstance_groups
def load_command_table(self, _):
with self.command_group('azurebaremetalinstance', client_factory=cf_azurebaremetalinstance_groups) as g:
g.custom_command('list', 'list_azurebaremetalinstance')
g.custom_command('show', 'show_azurebaremetalinstance', exception_handler=empty_on_404)

Просмотреть файл

@ -0,0 +1,16 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=no-self-use,too-many-lines
def show_azurebaremetalinstance(client, resource_group_name, instance_name):
return client.get(resource_group_name, instance_name)
def list_azurebaremetalinstance(client, resource_group_name=None):
if resource_group_name is None:
return client.list()
return client.list_by_resource_group(resource_group_name)

Просмотреть файл

@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .bare_metal_infrastructure_client import BareMetalInfrastructureClient
from .version import VERSION
__all__ = ['BareMetalInfrastructureClient']
__version__ = VERSION

Просмотреть файл

@ -0,0 +1,93 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.azure_bare_metal_instances_operations import AzureBareMetalInstancesOperations
from .operations.bare_metal_instances_operations import BareMetalInstancesOperations
from .operations.operations import Operations
from . import models
class BareMetalInfrastructureClientConfiguration(AzureConfiguration):
"""Configuration for BareMetalInfrastructureClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The Azure subscription ID. This is a
GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
:type subscription_id: str
:param str base_url: Service URL
"""
def __init__(
self, credentials, subscription_id, base_url=None):
if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'
super(BareMetalInfrastructureClientConfiguration, self).__init__(base_url)
self.add_user_agent('baremetalinfrastructure/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')
self.credentials = credentials
self.subscription_id = subscription_id
class BareMetalInfrastructureClient(SDKClient):
"""The BareMetalInfrastructure Management client
:ivar config: Configuration for client.
:vartype config: BareMetalInfrastructureClientConfiguration
:ivar azure_bare_metal_instances: AzureBareMetalInstances operations
:vartype azure_bare_metal_instances: microsoft.baremetalinfrastructure.operations.AzureBareMetalInstancesOperations
:ivar bare_metal_instances: BareMetalInstances operations
:vartype bare_metal_instances: microsoft.baremetalinfrastructure.operations.BareMetalInstancesOperations
:ivar operations: Operations operations
:vartype operations: microsoft.baremetalinfrastructure.operations.Operations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The Azure subscription ID. This is a
GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
:type subscription_id: str
:param str base_url: Service URL
"""
def __init__(
self, credentials, subscription_id, base_url=None):
self.config = BareMetalInfrastructureClientConfiguration(credentials, subscription_id, base_url)
super(BareMetalInfrastructureClient, self).__init__(self.config.credentials, self.config)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2020-08-06-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self.azure_bare_metal_instances = AzureBareMetalInstancesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.bare_metal_instances = BareMetalInstancesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)

Просмотреть файл

@ -0,0 +1,72 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
try:
from .resource_py3 import Resource
from .hardware_profile_py3 import HardwareProfile
from .disk_py3 import Disk
from .storage_profile_py3 import StorageProfile
from .os_profile_py3 import OSProfile
from .ip_address_py3 import IpAddress
from .network_profile_py3 import NetworkProfile
from .azure_bare_metal_instance_py3 import AzureBareMetalInstance
from .display_py3 import Display
from .operation_py3 import Operation
from .result_py3 import Result
from .error_definition_py3 import ErrorDefinition
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .tags_py3 import Tags
except (SyntaxError, ImportError):
from .resource import Resource
from .hardware_profile import HardwareProfile
from .disk import Disk
from .storage_profile import StorageProfile
from .os_profile import OSProfile
from .ip_address import IpAddress
from .network_profile import NetworkProfile
from .azure_bare_metal_instance import AzureBareMetalInstance
from .display import Display
from .operation import Operation
from .result import Result
from .error_definition import ErrorDefinition
from .error_response import ErrorResponse, ErrorResponseException
from .tags import Tags
from .azure_bare_metal_instance_paged import AzureBareMetalInstancePaged
from .operation_paged import OperationPaged
from .bare_metal_infrastructure_client_enums import (
AzureBareMetalHardwareTypeNamesEnum,
AzureBareMetalInstanceSizeNamesEnum,
AzureBareMetalInstancePowerStateEnum,
AzureBareMetalProvisioningStatesEnum,
)
__all__ = [
'Resource',
'HardwareProfile',
'Disk',
'StorageProfile',
'OSProfile',
'IpAddress',
'NetworkProfile',
'AzureBareMetalInstance',
'Display',
'Operation',
'Result',
'ErrorDefinition',
'ErrorResponse', 'ErrorResponseException',
'Tags',
'AzureBareMetalInstancePaged',
'OperationPaged',
'AzureBareMetalHardwareTypeNamesEnum',
'AzureBareMetalInstanceSizeNamesEnum',
'AzureBareMetalInstancePowerStateEnum',
'AzureBareMetalProvisioningStatesEnum',
]

Просмотреть файл

@ -0,0 +1,109 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .resource import Resource
class AzureBareMetalInstance(Resource):
"""AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal
properties).
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name
:vartype name: str
:ivar type: Resource type
:vartype type: str
:param location: Resource location
:type location: str
:ivar tags: Resource tags
:vartype tags: dict[str, str]
:param hardware_profile: Specifies the hardware settings for the
AzureBareMetal instance.
:type hardware_profile:
~microsoft.baremetalinfrastructure.models.HardwareProfile
:param storage_profile: Specifies the storage settings for the
AzureBareMetal instance disks.
:type storage_profile:
~microsoft.baremetalinfrastructure.models.StorageProfile
:param os_profile: Specifies the operating system settings for the
AzureBareMetal instance.
:type os_profile: ~microsoft.baremetalinfrastructure.models.OSProfile
:param network_profile: Specifies the network settings for the
AzureBareMetal instance.
:type network_profile:
~microsoft.baremetalinfrastructure.models.NetworkProfile
:ivar azure_bare_metal_instance_id: Specifies the AzureBareMetal instance
unique ID.
:vartype azure_bare_metal_instance_id: str
:ivar power_state: Resource power state. Possible values include:
'starting', 'started', 'stopping', 'stopped', 'restarting', 'unknown'
:vartype power_state: str or
~microsoft.baremetalinfrastructure.models.AzureBareMetalInstancePowerStateEnum
:ivar proximity_placement_group: Resource proximity placement group
:vartype proximity_placement_group: str
:ivar hw_revision: Hardware revision of an AzureBareMetal instance
:vartype hw_revision: str
:param partner_node_id: ARM ID of another AzureBareMetalInstance that will
share a network with this AzureBareMetalInstance
:type partner_node_id: str
:ivar provisioning_state: State of provisioning of the
AzureBareMetalInstance. Possible values include: 'Accepted', 'Creating',
'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating'
:vartype provisioning_state: str or
~microsoft.baremetalinfrastructure.models.AzureBareMetalProvisioningStatesEnum
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'tags': {'readonly': True},
'azure_bare_metal_instance_id': {'readonly': True},
'power_state': {'readonly': True},
'proximity_placement_group': {'readonly': True},
'hw_revision': {'readonly': True},
'provisioning_state': {'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}'},
'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'},
'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'},
'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'},
'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'},
'azure_bare_metal_instance_id': {'key': 'properties.azureBareMetalInstanceId', 'type': 'str'},
'power_state': {'key': 'properties.powerState', 'type': 'str'},
'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'str'},
'hw_revision': {'key': 'properties.hwRevision', 'type': 'str'},
'partner_node_id': {'key': 'properties.partnerNodeId', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
}
def __init__(self, **kwargs):
super(AzureBareMetalInstance, self).__init__(**kwargs)
self.hardware_profile = kwargs.get('hardware_profile', None)
self.storage_profile = kwargs.get('storage_profile', None)
self.os_profile = kwargs.get('os_profile', None)
self.network_profile = kwargs.get('network_profile', None)
self.azure_bare_metal_instance_id = None
self.power_state = None
self.proximity_placement_group = None
self.hw_revision = None
self.partner_node_id = kwargs.get('partner_node_id', None)
self.provisioning_state = None

Просмотреть файл

@ -0,0 +1,27 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.paging import Paged
class AzureBareMetalInstancePaged(Paged):
"""
A paging container for iterating over a list of :class:`AzureBareMetalInstance <microsoft.baremetalinfrastructure.models.AzureBareMetalInstance>` object
"""
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[AzureBareMetalInstance]'}
}
def __init__(self, *args, **kwargs):
super(AzureBareMetalInstancePaged, self).__init__(*args, **kwargs)

Просмотреть файл

@ -0,0 +1,109 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .resource_py3 import Resource
class AzureBareMetalInstance(Resource):
"""AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal
properties).
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name
:vartype name: str
:ivar type: Resource type
:vartype type: str
:param location: Resource location
:type location: str
:ivar tags: Resource tags
:vartype tags: dict[str, str]
:param hardware_profile: Specifies the hardware settings for the
AzureBareMetal instance.
:type hardware_profile:
~microsoft.baremetalinfrastructure.models.HardwareProfile
:param storage_profile: Specifies the storage settings for the
AzureBareMetal instance disks.
:type storage_profile:
~microsoft.baremetalinfrastructure.models.StorageProfile
:param os_profile: Specifies the operating system settings for the
AzureBareMetal instance.
:type os_profile: ~microsoft.baremetalinfrastructure.models.OSProfile
:param network_profile: Specifies the network settings for the
AzureBareMetal instance.
:type network_profile:
~microsoft.baremetalinfrastructure.models.NetworkProfile
:ivar azure_bare_metal_instance_id: Specifies the AzureBareMetal instance
unique ID.
:vartype azure_bare_metal_instance_id: str
:ivar power_state: Resource power state. Possible values include:
'starting', 'started', 'stopping', 'stopped', 'restarting', 'unknown'
:vartype power_state: str or
~microsoft.baremetalinfrastructure.models.AzureBareMetalInstancePowerStateEnum
:ivar proximity_placement_group: Resource proximity placement group
:vartype proximity_placement_group: str
:ivar hw_revision: Hardware revision of an AzureBareMetal instance
:vartype hw_revision: str
:param partner_node_id: ARM ID of another AzureBareMetalInstance that will
share a network with this AzureBareMetalInstance
:type partner_node_id: str
:ivar provisioning_state: State of provisioning of the
AzureBareMetalInstance. Possible values include: 'Accepted', 'Creating',
'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating'
:vartype provisioning_state: str or
~microsoft.baremetalinfrastructure.models.AzureBareMetalProvisioningStatesEnum
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'tags': {'readonly': True},
'azure_bare_metal_instance_id': {'readonly': True},
'power_state': {'readonly': True},
'proximity_placement_group': {'readonly': True},
'hw_revision': {'readonly': True},
'provisioning_state': {'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}'},
'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'},
'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'},
'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'},
'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'},
'azure_bare_metal_instance_id': {'key': 'properties.azureBareMetalInstanceId', 'type': 'str'},
'power_state': {'key': 'properties.powerState', 'type': 'str'},
'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'str'},
'hw_revision': {'key': 'properties.hwRevision', 'type': 'str'},
'partner_node_id': {'key': 'properties.partnerNodeId', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
}
def __init__(self, *, location: str=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, partner_node_id: str=None, **kwargs) -> None:
super(AzureBareMetalInstance, self).__init__(location=location, **kwargs)
self.hardware_profile = hardware_profile
self.storage_profile = storage_profile
self.os_profile = os_profile
self.network_profile = network_profile
self.azure_bare_metal_instance_id = None
self.power_state = None
self.proximity_placement_group = None
self.hw_revision = None
self.partner_node_id = partner_node_id
self.provisioning_state = None

Просмотреть файл

@ -0,0 +1,86 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from enum import Enum
class AzureBareMetalHardwareTypeNamesEnum(str, Enum):
cisco_ucs = "Cisco_UCS"
hpe = "HPE"
class AzureBareMetalInstanceSizeNamesEnum(str, Enum):
s72m = "S72m"
s144m = "S144m"
s72 = "S72"
s144 = "S144"
s192 = "S192"
s192m = "S192m"
s192xm = "S192xm"
s96 = "S96"
s112 = "S112"
s224 = "S224"
s224m = "S224m"
s224om = "S224om"
s224oo = "S224oo"
s224oom = "S224oom"
s224ooo = "S224ooo"
s384 = "S384"
s384m = "S384m"
s384xm = "S384xm"
s384xxm = "S384xxm"
s448 = "S448"
s448m = "S448m"
s448om = "S448om"
s448oo = "S448oo"
s448oom = "S448oom"
s448ooo = "S448ooo"
s576m = "S576m"
s576xm = "S576xm"
s672 = "S672"
s672m = "S672m"
s672om = "S672om"
s672oo = "S672oo"
s672oom = "S672oom"
s672ooo = "S672ooo"
s768 = "S768"
s768m = "S768m"
s768xm = "S768xm"
s896 = "S896"
s896m = "S896m"
s896om = "S896om"
s896oo = "S896oo"
s896oom = "S896oom"
s896ooo = "S896ooo"
s960m = "S960m"
class AzureBareMetalInstancePowerStateEnum(str, Enum):
starting = "starting"
started = "started"
stopping = "stopping"
stopped = "stopped"
restarting = "restarting"
unknown = "unknown"
class AzureBareMetalProvisioningStatesEnum(str, Enum):
accepted = "Accepted"
creating = "Creating"
updating = "Updating"
failed = "Failed"
succeeded = "Succeeded"
deleting = "Deleting"
migrating = "Migrating"

Просмотреть файл

@ -0,0 +1,46 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Disk(Model):
"""Specifies the disk information fo the AzureBareMetal instance.
Variables are only populated by the server, and will be ignored when
sending a request.
:param name: The disk name.
:type name: str
:param disk_size_gb: Specifies the size of an empty data disk in
gigabytes.
:type disk_size_gb: int
:ivar lun: Specifies the logical unit number of the data disk. This value
is used to identify data disks within the VM and therefore must be unique
for each data disk attached to a VM.
:vartype lun: int
"""
_validation = {
'lun': {'readonly': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'},
'lun': {'key': 'lun', 'type': 'int'},
}
def __init__(self, **kwargs):
super(Disk, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.disk_size_gb = kwargs.get('disk_size_gb', None)
self.lun = None

Просмотреть файл

@ -0,0 +1,46 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Disk(Model):
"""Specifies the disk information fo the AzureBareMetal instance.
Variables are only populated by the server, and will be ignored when
sending a request.
:param name: The disk name.
:type name: str
:param disk_size_gb: Specifies the size of an empty data disk in
gigabytes.
:type disk_size_gb: int
:ivar lun: Specifies the logical unit number of the data disk. This value
is used to identify data disks within the VM and therefore must be unique
for each data disk attached to a VM.
:vartype lun: int
"""
_validation = {
'lun': {'readonly': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'},
'lun': {'key': 'lun', 'type': 'int'},
}
def __init__(self, *, name: str=None, disk_size_gb: int=None, **kwargs) -> None:
super(Disk, self).__init__(**kwargs)
self.name = name
self.disk_size_gb = disk_size_gb
self.lun = None

Просмотреть файл

@ -0,0 +1,67 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Display(Model):
"""Detailed BareMetal operation information.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar provider: The localized friendly form of the resource provider name.
This form is also expected to include the publisher/company responsible.
Use Title Casing. Begin with "Microsoft" for 1st party services.
:vartype provider: str
:ivar resource: The localized friendly form of the resource type related
to this action/operation. This form should match the public documentation
for the resource provider. Use Title Casing. For examples, refer to the
name section.
:vartype resource: str
:ivar operation: The localized friendly name for the operation as shown to
the user. This name should be concise (to fit in drop downs), but clear
(self-documenting). Use Title Casing and include the entity/resource to
which it applies.
:vartype operation: str
:ivar description: The localized friendly description for the operation as
shown to the user. This description should be thorough, yet concise. It
will be used in tool-tips and detailed views.
:vartype description: str
:ivar origin: The intended executor of the operation; governs the display
of the operation in the RBAC UX and the audit logs UX. Default value is
'user,system'
:vartype origin: str
"""
_validation = {
'provider': {'readonly': True},
'resource': {'readonly': True},
'operation': {'readonly': True},
'description': {'readonly': True},
'origin': {'readonly': True},
}
_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'origin': {'key': 'origin', 'type': 'str'},
}
def __init__(self, **kwargs):
super(Display, self).__init__(**kwargs)
self.provider = None
self.resource = None
self.operation = None
self.description = None
self.origin = None

Просмотреть файл

@ -0,0 +1,67 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Display(Model):
"""Detailed BareMetal operation information.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar provider: The localized friendly form of the resource provider name.
This form is also expected to include the publisher/company responsible.
Use Title Casing. Begin with "Microsoft" for 1st party services.
:vartype provider: str
:ivar resource: The localized friendly form of the resource type related
to this action/operation. This form should match the public documentation
for the resource provider. Use Title Casing. For examples, refer to the
name section.
:vartype resource: str
:ivar operation: The localized friendly name for the operation as shown to
the user. This name should be concise (to fit in drop downs), but clear
(self-documenting). Use Title Casing and include the entity/resource to
which it applies.
:vartype operation: str
:ivar description: The localized friendly description for the operation as
shown to the user. This description should be thorough, yet concise. It
will be used in tool-tips and detailed views.
:vartype description: str
:ivar origin: The intended executor of the operation; governs the display
of the operation in the RBAC UX and the audit logs UX. Default value is
'user,system'
:vartype origin: str
"""
_validation = {
'provider': {'readonly': True},
'resource': {'readonly': True},
'operation': {'readonly': True},
'description': {'readonly': True},
'origin': {'readonly': True},
}
_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'origin': {'key': 'origin', 'type': 'str'},
}
def __init__(self, **kwargs) -> None:
super(Display, self).__init__(**kwargs)
self.provider = None
self.resource = None
self.operation = None
self.description = None
self.origin = None

Просмотреть файл

@ -0,0 +1,47 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ErrorDefinition(Model):
"""Error definition.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar code: Service specific error code which serves as the substatus for
the HTTP error code.
:vartype code: str
:ivar message: Description of the error.
:vartype message: str
:ivar details: Internal error details.
:vartype details:
list[~microsoft.baremetalinfrastructure.models.ErrorDefinition]
"""
_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
'details': {'readonly': True},
}
_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorDefinition]'},
}
def __init__(self, **kwargs):
super(ErrorDefinition, self).__init__(**kwargs)
self.code = None
self.message = None
self.details = None

Просмотреть файл

@ -0,0 +1,47 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ErrorDefinition(Model):
"""Error definition.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar code: Service specific error code which serves as the substatus for
the HTTP error code.
:vartype code: str
:ivar message: Description of the error.
:vartype message: str
:ivar details: Internal error details.
:vartype details:
list[~microsoft.baremetalinfrastructure.models.ErrorDefinition]
"""
_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
'details': {'readonly': True},
}
_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorDefinition]'},
}
def __init__(self, **kwargs) -> None:
super(ErrorDefinition, self).__init__(**kwargs)
self.code = None
self.message = None
self.details = None

Просмотреть файл

@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
from msrest.exceptions import HttpOperationError
class ErrorResponse(Model):
"""Error response.
:param error: The error details.
:type error: ~microsoft.baremetalinfrastructure.models.ErrorDefinition
"""
_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorDefinition'},
}
def __init__(self, **kwargs):
super(ErrorResponse, self).__init__(**kwargs)
self.error = kwargs.get('error', None)
class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.
:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""
def __init__(self, deserialize, response, *args):
super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)

Просмотреть файл

@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
from msrest.exceptions import HttpOperationError
class ErrorResponse(Model):
"""Error response.
:param error: The error details.
:type error: ~microsoft.baremetalinfrastructure.models.ErrorDefinition
"""
_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorDefinition'},
}
def __init__(self, *, error=None, **kwargs) -> None:
super(ErrorResponse, self).__init__(**kwargs)
self.error = error
class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.
:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""
def __init__(self, deserialize, response, *args):
super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)

Просмотреть файл

@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class HardwareProfile(Model):
"""Specifies the hardware settings for the AzureBareMetal instance.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar hardware_type: Name of the hardware type (vendor and/or their
product name). Possible values include: 'Cisco_UCS', 'HPE'
:vartype hardware_type: str or
~microsoft.baremetalinfrastructure.models.AzureBareMetalHardwareTypeNamesEnum
:ivar azure_bare_metal_instance_size: Specifies the AzureBareMetal
instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144',
'S192', 'S192m', 'S192xm', 'S96', 'S112', 'S224', 'S224m', 'S224om',
'S224oo', 'S224oom', 'S224ooo', 'S384', 'S384m', 'S384xm', 'S384xxm',
'S448', 'S448m', 'S448om', 'S448oo', 'S448oom', 'S448ooo', 'S576m',
'S576xm', 'S672', 'S672m', 'S672om', 'S672oo', 'S672oom', 'S672ooo',
'S768', 'S768m', 'S768xm', 'S896', 'S896m', 'S896om', 'S896oo', 'S896oom',
'S896ooo', 'S960m'
:vartype azure_bare_metal_instance_size: str or
~microsoft.baremetalinfrastructure.models.AzureBareMetalInstanceSizeNamesEnum
"""
_validation = {
'hardware_type': {'readonly': True},
'azure_bare_metal_instance_size': {'readonly': True},
}
_attribute_map = {
'hardware_type': {'key': 'hardwareType', 'type': 'str'},
'azure_bare_metal_instance_size': {'key': 'azureBareMetalInstanceSize', 'type': 'str'},
}
def __init__(self, **kwargs):
super(HardwareProfile, self).__init__(**kwargs)
self.hardware_type = None
self.azure_bare_metal_instance_size = None

Просмотреть файл

@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class HardwareProfile(Model):
"""Specifies the hardware settings for the AzureBareMetal instance.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar hardware_type: Name of the hardware type (vendor and/or their
product name). Possible values include: 'Cisco_UCS', 'HPE'
:vartype hardware_type: str or
~microsoft.baremetalinfrastructure.models.AzureBareMetalHardwareTypeNamesEnum
:ivar azure_bare_metal_instance_size: Specifies the AzureBareMetal
instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144',
'S192', 'S192m', 'S192xm', 'S96', 'S112', 'S224', 'S224m', 'S224om',
'S224oo', 'S224oom', 'S224ooo', 'S384', 'S384m', 'S384xm', 'S384xxm',
'S448', 'S448m', 'S448om', 'S448oo', 'S448oom', 'S448ooo', 'S576m',
'S576xm', 'S672', 'S672m', 'S672om', 'S672oo', 'S672oom', 'S672ooo',
'S768', 'S768m', 'S768xm', 'S896', 'S896m', 'S896om', 'S896oo', 'S896oom',
'S896ooo', 'S960m'
:vartype azure_bare_metal_instance_size: str or
~microsoft.baremetalinfrastructure.models.AzureBareMetalInstanceSizeNamesEnum
"""
_validation = {
'hardware_type': {'readonly': True},
'azure_bare_metal_instance_size': {'readonly': True},
}
_attribute_map = {
'hardware_type': {'key': 'hardwareType', 'type': 'str'},
'azure_bare_metal_instance_size': {'key': 'azureBareMetalInstanceSize', 'type': 'str'},
}
def __init__(self, **kwargs) -> None:
super(HardwareProfile, self).__init__(**kwargs)
self.hardware_type = None
self.azure_bare_metal_instance_size = None

Просмотреть файл

@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class IpAddress(Model):
"""Specifies the IP address of the network interface.
:param ip_address: Specifies the IP address of the network interface.
:type ip_address: str
"""
_attribute_map = {
'ip_address': {'key': 'ipAddress', 'type': 'str'},
}
def __init__(self, **kwargs):
super(IpAddress, self).__init__(**kwargs)
self.ip_address = kwargs.get('ip_address', None)

Просмотреть файл

@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class IpAddress(Model):
"""Specifies the IP address of the network interface.
:param ip_address: Specifies the IP address of the network interface.
:type ip_address: str
"""
_attribute_map = {
'ip_address': {'key': 'ipAddress', 'type': 'str'},
}
def __init__(self, *, ip_address: str=None, **kwargs) -> None:
super(IpAddress, self).__init__(**kwargs)
self.ip_address = ip_address

Просмотреть файл

@ -0,0 +1,42 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class NetworkProfile(Model):
"""Specifies the network settings for the AzureBareMetal instance disks.
Variables are only populated by the server, and will be ignored when
sending a request.
:param network_interfaces: Specifies the network interfaces for the
AzureBareMetal instance.
:type network_interfaces:
list[~microsoft.baremetalinfrastructure.models.IpAddress]
:ivar circuit_id: Specifies the circuit id for connecting to express
route.
:vartype circuit_id: str
"""
_validation = {
'circuit_id': {'readonly': True},
}
_attribute_map = {
'network_interfaces': {'key': 'networkInterfaces', 'type': '[IpAddress]'},
'circuit_id': {'key': 'circuitId', 'type': 'str'},
}
def __init__(self, **kwargs):
super(NetworkProfile, self).__init__(**kwargs)
self.network_interfaces = kwargs.get('network_interfaces', None)
self.circuit_id = None

Просмотреть файл

@ -0,0 +1,42 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class NetworkProfile(Model):
"""Specifies the network settings for the AzureBareMetal instance disks.
Variables are only populated by the server, and will be ignored when
sending a request.
:param network_interfaces: Specifies the network interfaces for the
AzureBareMetal instance.
:type network_interfaces:
list[~microsoft.baremetalinfrastructure.models.IpAddress]
:ivar circuit_id: Specifies the circuit id for connecting to express
route.
:vartype circuit_id: str
"""
_validation = {
'circuit_id': {'readonly': True},
}
_attribute_map = {
'network_interfaces': {'key': 'networkInterfaces', 'type': '[IpAddress]'},
'circuit_id': {'key': 'circuitId', 'type': 'str'},
}
def __init__(self, *, network_interfaces=None, **kwargs) -> None:
super(NetworkProfile, self).__init__(**kwargs)
self.network_interfaces = network_interfaces
self.circuit_id = None

Просмотреть файл

@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Operation(Model):
"""AzureBareMetal operation information.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name: The name of the operation being performed on this particular
object. This name should match the action name that appears in RBAC / the
event service.
:vartype name: str
:param display: Displayed AzureBareMetal operation information
:type display: ~microsoft.baremetalinfrastructure.models.Display
"""
_validation = {
'name': {'readonly': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'Display'},
}
def __init__(self, **kwargs):
super(Operation, self).__init__(**kwargs)
self.name = None
self.display = kwargs.get('display', None)

Просмотреть файл

@ -0,0 +1,27 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.paging import Paged
class OperationPaged(Paged):
"""
A paging container for iterating over a list of :class:`Operation <microsoft.baremetalinfrastructure.models.Operation>` object
"""
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[Operation]'}
}
def __init__(self, *args, **kwargs):
super(OperationPaged, self).__init__(*args, **kwargs)

Просмотреть файл

@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Operation(Model):
"""AzureBareMetal operation information.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name: The name of the operation being performed on this particular
object. This name should match the action name that appears in RBAC / the
event service.
:vartype name: str
:param display: Displayed AzureBareMetal operation information
:type display: ~microsoft.baremetalinfrastructure.models.Display
"""
_validation = {
'name': {'readonly': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'Display'},
}
def __init__(self, *, display=None, **kwargs) -> None:
super(Operation, self).__init__(**kwargs)
self.name = None
self.display = display

Просмотреть файл

@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class OSProfile(Model):
"""Specifies the operating system settings for the AzureBareMetal instance.
Variables are only populated by the server, and will be ignored when
sending a request.
:param computer_name: Specifies the host OS name of the AzureBareMetal
instance.
:type computer_name: str
:ivar os_type: This property allows you to specify the type of the OS.
:vartype os_type: str
:ivar version: Specifies version of operating system.
:vartype version: str
:param ssh_public_key: Specifies the SSH public key used to access the
operating system.
:type ssh_public_key: str
"""
_validation = {
'os_type': {'readonly': True},
'version': {'readonly': True},
}
_attribute_map = {
'computer_name': {'key': 'computerName', 'type': 'str'},
'os_type': {'key': 'osType', 'type': 'str'},
'version': {'key': 'version', 'type': 'str'},
'ssh_public_key': {'key': 'sshPublicKey', 'type': 'str'},
}
def __init__(self, **kwargs):
super(OSProfile, self).__init__(**kwargs)
self.computer_name = kwargs.get('computer_name', None)
self.os_type = None
self.version = None
self.ssh_public_key = kwargs.get('ssh_public_key', None)

Просмотреть файл

@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class OSProfile(Model):
"""Specifies the operating system settings for the AzureBareMetal instance.
Variables are only populated by the server, and will be ignored when
sending a request.
:param computer_name: Specifies the host OS name of the AzureBareMetal
instance.
:type computer_name: str
:ivar os_type: This property allows you to specify the type of the OS.
:vartype os_type: str
:ivar version: Specifies version of operating system.
:vartype version: str
:param ssh_public_key: Specifies the SSH public key used to access the
operating system.
:type ssh_public_key: str
"""
_validation = {
'os_type': {'readonly': True},
'version': {'readonly': True},
}
_attribute_map = {
'computer_name': {'key': 'computerName', 'type': 'str'},
'os_type': {'key': 'osType', 'type': 'str'},
'version': {'key': 'version', 'type': 'str'},
'ssh_public_key': {'key': 'sshPublicKey', 'type': 'str'},
}
def __init__(self, *, computer_name: str=None, ssh_public_key: str=None, **kwargs) -> None:
super(OSProfile, self).__init__(**kwargs)
self.computer_name = computer_name
self.os_type = None
self.version = None
self.ssh_public_key = ssh_public_key

Просмотреть файл

@ -0,0 +1,54 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Resource(Model):
"""The resource model definition.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name
:vartype name: str
:ivar type: Resource type
:vartype type: str
:param location: Resource location
:type location: str
:ivar tags: Resource tags
:vartype tags: dict[str, str]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'tags': {'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}'},
}
def __init__(self, **kwargs):
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.location = kwargs.get('location', None)
self.tags = None

Просмотреть файл

@ -0,0 +1,54 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Resource(Model):
"""The resource model definition.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name
:vartype name: str
:ivar type: Resource type
:vartype type: str
:param location: Resource location
:type location: str
:ivar tags: Resource tags
:vartype tags: dict[str, str]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'tags': {'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}'},
}
def __init__(self, *, location: str=None, **kwargs) -> None:
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.location = location
self.tags = None

Просмотреть файл

@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Result(Model):
"""Sample result definition.
:param sample_property: Sample property of type string
:type sample_property: str
"""
_attribute_map = {
'sample_property': {'key': 'sampleProperty', 'type': 'str'},
}
def __init__(self, **kwargs):
super(Result, self).__init__(**kwargs)
self.sample_property = kwargs.get('sample_property', None)

Просмотреть файл

@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Result(Model):
"""Sample result definition.
:param sample_property: Sample property of type string
:type sample_property: str
"""
_attribute_map = {
'sample_property': {'key': 'sampleProperty', 'type': 'str'},
}
def __init__(self, *, sample_property: str=None, **kwargs) -> None:
super(Result, self).__init__(**kwargs)
self.sample_property = sample_property

Просмотреть файл

@ -0,0 +1,40 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class StorageProfile(Model):
"""Specifies the storage settings for the AzureBareMetal instance disks.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar nfs_ip_address: IP Address to connect to storage.
:vartype nfs_ip_address: str
:param os_disks: Specifies information about the operating system disk
used by baremetal instance.
:type os_disks: list[~microsoft.baremetalinfrastructure.models.Disk]
"""
_validation = {
'nfs_ip_address': {'readonly': True},
}
_attribute_map = {
'nfs_ip_address': {'key': 'nfsIpAddress', 'type': 'str'},
'os_disks': {'key': 'osDisks', 'type': '[Disk]'},
}
def __init__(self, **kwargs):
super(StorageProfile, self).__init__(**kwargs)
self.nfs_ip_address = None
self.os_disks = kwargs.get('os_disks', None)

Просмотреть файл

@ -0,0 +1,40 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class StorageProfile(Model):
"""Specifies the storage settings for the AzureBareMetal instance disks.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar nfs_ip_address: IP Address to connect to storage.
:vartype nfs_ip_address: str
:param os_disks: Specifies information about the operating system disk
used by baremetal instance.
:type os_disks: list[~microsoft.baremetalinfrastructure.models.Disk]
"""
_validation = {
'nfs_ip_address': {'readonly': True},
}
_attribute_map = {
'nfs_ip_address': {'key': 'nfsIpAddress', 'type': 'str'},
'os_disks': {'key': 'osDisks', 'type': '[Disk]'},
}
def __init__(self, *, os_disks=None, **kwargs) -> None:
super(StorageProfile, self).__init__(**kwargs)
self.nfs_ip_address = None
self.os_disks = os_disks

Просмотреть файл

@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Tags(Model):
"""Tags field of the AzureBareMetal instance.
:param tags: Tags field of the AzureBareMetal instance.
:type tags: dict[str, str]
"""
_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, **kwargs):
super(Tags, self).__init__(**kwargs)
self.tags = kwargs.get('tags', None)

Просмотреть файл

@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Tags(Model):
"""Tags field of the AzureBareMetal instance.
:param tags: Tags field of the AzureBareMetal instance.
:type tags: dict[str, str]
"""
_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, *, tags=None, **kwargs) -> None:
super(Tags, self).__init__(**kwargs)
self.tags = tags

Просмотреть файл

@ -0,0 +1,20 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .azure_bare_metal_instances_operations import AzureBareMetalInstancesOperations
from .bare_metal_instances_operations import BareMetalInstancesOperations
from .operations import Operations
__all__ = [
'AzureBareMetalInstancesOperations',
'BareMetalInstancesOperations',
'Operations',
]

Просмотреть файл

@ -0,0 +1,565 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
import uuid
from msrest.pipeline import ClientRawResponse
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class AzureBareMetalInstancesOperations(object):
"""AzureBareMetalInstancesOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-08-06-preview".
"""
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2020-08-06-preview"
self.config = config
def _start_initial(
self, resource_group_name, azure_bare_metal_instance_name, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.start.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'azureBareMetalInstanceName': self._serialize.url("azure_bare_metal_instance_name", azure_bare_metal_instance_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
# Construct headers
header_parameters = {}
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200, 202]:
raise models.ErrorResponseException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def start(
self, resource_group_name, azure_bare_metal_instance_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""The operation to start an AzureBareMetal instance.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param azure_bare_metal_instance_name: Name of the Azure BareMetal on
Azure instance.
:type azure_bare_metal_instance_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises:
:class:`ErrorResponseException<microsoft.baremetalinfrastructure.models.ErrorResponseException>`
"""
raw_result = self._start_initial(
resource_group_name=resource_group_name,
azure_bare_metal_instance_name=azure_bare_metal_instance_name,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}/start'}
def _restart_initial(
self, resource_group_name, azure_bare_metal_instance_name, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.restart.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'azureBareMetalInstanceName': self._serialize.url("azure_bare_metal_instance_name", azure_bare_metal_instance_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
# Construct headers
header_parameters = {}
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200, 202]:
raise models.ErrorResponseException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def restart(
self, resource_group_name, azure_bare_metal_instance_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""The operation to restart an AzureBareMetal instance.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param azure_bare_metal_instance_name: Name of the Azure BareMetal on
Azure instance.
:type azure_bare_metal_instance_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises:
:class:`ErrorResponseException<microsoft.baremetalinfrastructure.models.ErrorResponseException>`
"""
raw_result = self._restart_initial(
resource_group_name=resource_group_name,
azure_bare_metal_instance_name=azure_bare_metal_instance_name,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}/restart'}
def _shutdown_initial(
self, resource_group_name, azure_bare_metal_instance_name, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.shutdown.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'azureBareMetalInstanceName': self._serialize.url("azure_bare_metal_instance_name", azure_bare_metal_instance_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
# Construct headers
header_parameters = {}
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200, 202]:
raise models.ErrorResponseException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def shutdown(
self, resource_group_name, azure_bare_metal_instance_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""The operation to shutdown an AzureBareMetal instance.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param azure_bare_metal_instance_name: Name of the Azure BareMetal on
Azure instance.
:type azure_bare_metal_instance_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises:
:class:`ErrorResponseException<microsoft.baremetalinfrastructure.models.ErrorResponseException>`
"""
raw_result = self._shutdown_initial(
resource_group_name=resource_group_name,
azure_bare_metal_instance_name=azure_bare_metal_instance_name,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
shutdown.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}/shutdown'}
def list_by_resource_group(
self, resource_group_name, custom_headers=None, raw=False, **operation_config):
"""Gets a list of AzureBareMetal instances in the specified subscription
and resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of AzureBareMetalInstance
:rtype:
~microsoft.baremetalinfrastructure.models.AzureBareMetalInstancePaged[~microsoft.baremetalinfrastructure.models.AzureBareMetalInstance]
:raises:
:class:`ErrorResponseException<microsoft.baremetalinfrastructure.models.ErrorResponseException>`
"""
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = self.list_by_resource_group.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
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:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
return response
# Deserialize response
deserialized = models.AzureBareMetalInstancePaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.AzureBareMetalInstancePaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances'}
def get(
self, resource_group_name, azure_bare_metal_instance_name, custom_headers=None, raw=False, **operation_config):
"""Gets an Azure BareMetal instance.
Gets an Azure BareMetal instance for the specified subscription,
resource group, and instance name.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param azure_bare_metal_instance_name: Name of the Azure BareMetal on
Azure instance.
:type azure_bare_metal_instance_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: AzureBareMetalInstance or ClientRawResponse if raw=true
:rtype:
~microsoft.baremetalinfrastructure.models.AzureBareMetalInstance or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<microsoft.baremetalinfrastructure.models.ErrorResponseException>`
"""
# Construct URL
url = self.get.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'azureBareMetalInstanceName': self._serialize.url("azure_bare_metal_instance_name", azure_bare_metal_instance_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
# Construct headers
header_parameters = {}
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:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('AzureBareMetalInstance', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}'}
def _delete_initial(
self, resource_group_name, azure_bare_metal_instance_name, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.delete.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'azureBareMetalInstanceName': self._serialize.url("azure_bare_metal_instance_name", azure_bare_metal_instance_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
# Construct headers
header_parameters = {}
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200, 202, 204]:
raise models.ErrorResponseException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
def delete(
self, resource_group_name, azure_bare_metal_instance_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Deletes a Azure BareMetal instance.
Deletes a Azure BareMetal instance with the specified subscription,
resource group, and instance name.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param azure_bare_metal_instance_name: Name of the Azure BareMetal on
Azure instance.
:type azure_bare_metal_instance_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises:
:class:`ErrorResponseException<microsoft.baremetalinfrastructure.models.ErrorResponseException>`
"""
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
azure_bare_metal_instance_name=azure_bare_metal_instance_name,
custom_headers=custom_headers,
raw=True,
**operation_config
)
def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}'}
def update(
self, resource_group_name, azure_bare_metal_instance_name, tags=None, custom_headers=None, raw=False, **operation_config):
"""Patches the Tags field of a Azure BareMetal instance.
Patches the Tags field of a Azure BareMetal instance for the specified
subscription, resource group, and instance name.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param azure_bare_metal_instance_name: Name of the Azure BareMetal on
Azure instance.
:type azure_bare_metal_instance_name: str
:param tags: Tags field of the AzureBareMetal instance.
:type tags: dict[str, str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: AzureBareMetalInstance or ClientRawResponse if raw=true
:rtype:
~microsoft.baremetalinfrastructure.models.AzureBareMetalInstance or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<microsoft.baremetalinfrastructure.models.ErrorResponseException>`
"""
tags_parameter = models.Tags(tags=tags)
# Construct URL
url = self.update.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'azureBareMetalInstanceName': self._serialize.url("azure_bare_metal_instance_name", azure_bare_metal_instance_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
# 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())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
# Construct body
body_content = self._serialize.body(tags_parameter, 'Tags')
# Construct and send request
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]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('AzureBareMetalInstance', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}'}

Просмотреть файл

@ -0,0 +1,104 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
import uuid
from msrest.pipeline import ClientRawResponse
from .. import models
class BareMetalInstancesOperations(object):
"""BareMetalInstancesOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-08-06-preview".
"""
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2020-08-06-preview"
self.config = config
def list(
self, custom_headers=None, raw=False, **operation_config):
"""Gets a list of Azure BareMetal instances in the specified subscription.
Gets a list of AzureBareMetal instances in the specified subscription.
The operations returns various properties of each Azure BareMetal
instance.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of AzureBareMetalInstance
:rtype:
~microsoft.baremetalinfrastructure.models.AzureBareMetalInstancePaged[~microsoft.baremetalinfrastructure.models.AzureBareMetalInstance]
:raises:
:class:`ErrorResponseException<microsoft.baremetalinfrastructure.models.ErrorResponseException>`
"""
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = self.list.metadata['url']
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 = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
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:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
return response
# Deserialize response
deserialized = models.AzureBareMetalInstancePaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.AzureBareMetalInstancePaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances'}

Просмотреть файл

@ -0,0 +1,96 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
import uuid
from msrest.pipeline import ClientRawResponse
from .. import models
class Operations(object):
"""Operations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-08-06-preview".
"""
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2020-08-06-preview"
self.config = config
def list(
self, custom_headers=None, raw=False, **operation_config):
"""Gets a list of AzureBareMetal management operations.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of Operation
:rtype:
~microsoft.baremetalinfrastructure.models.OperationPaged[~microsoft.baremetalinfrastructure.models.Operation]
:raises:
:class:`ErrorResponseException<microsoft.baremetalinfrastructure.models.ErrorResponseException>`
"""
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = self.list.metadata['url']
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
else:
url = next_link
query_parameters = {}
# Construct headers
header_parameters = {}
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:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
return response
# Deserialize response
deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies)
if raw:
header_dict = {}
client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response
return deserialized
list.metadata = {'url': '/providers/Microsoft.BareMetalInfrastructure/operations'}

Просмотреть файл

@ -0,0 +1,13 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
VERSION = "2020-08-06-preview"

4
azext_metadata.json Normal file
Просмотреть файл

@ -0,0 +1,4 @@
{
"azext.minCliCoreVersion": "2.0.25",
"version": "0.1.0"
}

2
setup.cfg Normal file
Просмотреть файл

@ -0,0 +1,2 @@
[bdist_wheel]
universal=1

47
setup.py Normal file
Просмотреть файл

@ -0,0 +1,47 @@
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from codecs import open
from setuptools import setup, find_packages
VERSION = "0.0.1"
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'License :: OSI Approved :: MIT License',
]
DEPENDENCIES = []
with open('README.rst', 'r', encoding='utf-8') as f:
README = f.read()
with open('HISTORY.rst', 'r', encoding='utf-8') as f:
HISTORY = f.read()
setup(
name='azure-baremetal',
version=VERSION,
description='Additional commands for working with Azure Bare Metal instances.',
long_description=README + '\n\n' + HISTORY,
license='MIT',
author='Microsoft Corporation',
author_email='azpycli@microsoft.com',
url='https://github.com/Azure/azure-baremetalinfrastructure-cli-extension',
classifiers=CLASSIFIERS,
packages=find_packages(),
package_data={'azext_baremetalinfrastructure': ['azext_metadata.json']},
install_requires=DEPENDENCIES
)