Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoRelease] t2-connectedvmware-2022-08-08-58427(Do not merge) #25598

Merged
merged 2 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions sdk/connectedvmware/azure-mgmt-connectedvmware/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Release History

## 1.0.0b2 (2022-08-15)

**Features**

- Added operation VirtualMachinesOperations.begin_assess_patches
- Added operation VirtualMachinesOperations.begin_install_patches
- Model MachineExtension has a new parameter enable_automatic_upgrade
- Model MachineExtensionUpdate has a new parameter enable_automatic_upgrade
- Model OsProfile has a new parameter allow_extension_operations
- Model OsProfile has a new parameter guest_id
- Model OsProfile has a new parameter linux_configuration
- Model OsProfile has a new parameter windows_configuration
- Model VirtualMachine has a new parameter security_profile
- Model VirtualMachineUpdate has a new parameter os_profile

**Breaking changes**

- Operation VirtualMachinesOperations.begin_delete has a new parameter retain

## 1.0.0b1 (2021-11-19)

* Initial Release
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include _meta.json
recursive-include tests *.py *.yaml
recursive-include tests *.py *.json
include *.md
include azure/__init__.py
include azure/mgmt/__init__.py
include LICENSE
include azure/mgmt/connectedvmware/py.typed
2 changes: 1 addition & 1 deletion sdk/connectedvmware/azure-mgmt-connectedvmware/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure Connected VMWare Management Client Library.
This package has been tested with Python 3.6+.
This package has been tested with Python 3.7+.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).

## _Disclaimer_
Expand Down
10 changes: 5 additions & 5 deletions sdk/connectedvmware/azure-mgmt-connectedvmware/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.4.5",
"autorest": "3.7.2",
"use": [
"@autorest/python@5.8.4",
"@autorest/[email protected].2"
"@autorest/python@5.16.0",
"@autorest/[email protected].3"
],
"commit": "bd288bec4a31b114a29630cebc9b0c6c4c0686ed",
"commit": "73adb85475a18edba013d4d0eb89d579e76648ae",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/connectedvmware/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/[email protected].2 --version=3.4.5",
"autorest_command": "autorest specification/connectedvmware/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/[email protected].3 --version=3.7.2",
"readme": "specification/connectedvmware/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
from ._version import VERSION

__version__ = VERSION
__all__ = ['AzureArcVMwareManagementServiceAPI']

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
except ImportError:
pass
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['AzureArcVMwareManagementServiceAPI']
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,29 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING
from copy import deepcopy
from typing import Any, TYPE_CHECKING

from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient

from ._configuration import AzureArcVMwareManagementServiceAPIConfiguration
from .operations import Operations
from .operations import ResourcePoolsOperations
from .operations import ClustersOperations
from .operations import HostsOperations
from .operations import DatastoresOperations
from .operations import VCentersOperations
from .operations import VirtualMachinesOperations
from .operations import VirtualMachineTemplatesOperations
from .operations import VirtualNetworksOperations
from .operations import InventoryItemsOperations
from .operations import HybridIdentityMetadataOperations
from .operations import MachineExtensionsOperations
from .operations import GuestAgentsOperations
from . import models
from ._configuration import AzureArcVMwareManagementServiceAPIConfiguration
from .operations import ClustersOperations, DatastoresOperations, GuestAgentsOperations, HostsOperations, HybridIdentityMetadataOperations, InventoryItemsOperations, MachineExtensionsOperations, Operations, ResourcePoolsOperations, VCentersOperations, VirtualMachineTemplatesOperations, VirtualMachinesOperations, VirtualNetworksOperations

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential

class AzureArcVMwareManagementServiceAPI(object):
class AzureArcVMwareManagementServiceAPI: # pylint: disable=too-many-instance-attributes
"""Self service experience for VMware.

:ivar operations: Operations operations
:vartype operations: azure.mgmt.connectedvmware.operations.Operations
:ivar virtual_machines: VirtualMachinesOperations operations
:vartype virtual_machines: azure.mgmt.connectedvmware.operations.VirtualMachinesOperations
:ivar resource_pools: ResourcePoolsOperations operations
:vartype resource_pools: azure.mgmt.connectedvmware.operations.ResourcePoolsOperations
:ivar clusters: ClustersOperations operations
Expand All @@ -50,16 +39,16 @@ class AzureArcVMwareManagementServiceAPI(object):
:vartype datastores: azure.mgmt.connectedvmware.operations.DatastoresOperations
:ivar vcenters: VCentersOperations operations
:vartype vcenters: azure.mgmt.connectedvmware.operations.VCentersOperations
:ivar virtual_machines: VirtualMachinesOperations operations
:vartype virtual_machines: azure.mgmt.connectedvmware.operations.VirtualMachinesOperations
:ivar virtual_machine_templates: VirtualMachineTemplatesOperations operations
:vartype virtual_machine_templates: azure.mgmt.connectedvmware.operations.VirtualMachineTemplatesOperations
:vartype virtual_machine_templates:
azure.mgmt.connectedvmware.operations.VirtualMachineTemplatesOperations
:ivar virtual_networks: VirtualNetworksOperations operations
:vartype virtual_networks: azure.mgmt.connectedvmware.operations.VirtualNetworksOperations
:ivar inventory_items: InventoryItemsOperations operations
:vartype inventory_items: azure.mgmt.connectedvmware.operations.InventoryItemsOperations
:ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations
:vartype hybrid_identity_metadata: azure.mgmt.connectedvmware.operations.HybridIdentityMetadataOperations
:vartype hybrid_identity_metadata:
azure.mgmt.connectedvmware.operations.HybridIdentityMetadataOperations
:ivar machine_extensions: MachineExtensionsOperations operations
:vartype machine_extensions: azure.mgmt.connectedvmware.operations.MachineExtensionsOperations
:ivar guest_agents: GuestAgentsOperations operations
Expand All @@ -68,72 +57,95 @@ class AzureArcVMwareManagementServiceAPI(object):
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Subscription ID.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-01-10-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
base_url=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = AzureArcVMwareManagementServiceAPIConfiguration(credential, subscription_id, **kwargs)
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AzureArcVMwareManagementServiceAPIConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self._serialize.client_side_validation = False
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.virtual_machines = VirtualMachinesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.resource_pools = ResourcePoolsOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.clusters = ClustersOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.hosts = HostsOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.datastores = DatastoresOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.vcenters = VCentersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.virtual_machines = VirtualMachinesOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.virtual_machine_templates = VirtualMachineTemplatesOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.virtual_networks = VirtualNetworksOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.inventory_items = InventoryItemsOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.hybrid_identity_metadata = HybridIdentityMetadataOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.machine_extensions = MachineExtensionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)
self.guest_agents = GuestAgentsOperations(
self._client, self._config, self._serialize, self._deserialize)
self._client, self._config, self._serialize, self._deserialize
)


def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client._send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart

:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
:rtype: ~azure.core.rest.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)

def close(self):
# type: () -> None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential


class AzureArcVMwareManagementServiceAPIConfiguration(Configuration):
class AzureArcVMwareManagementServiceAPIConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for AzureArcVMwareManagementServiceAPI.

Note that all parameters used to create this instance are saved as instance
Expand All @@ -31,24 +29,28 @@ class AzureArcVMwareManagementServiceAPIConfiguration(Configuration):
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Subscription ID.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-01-10-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
):
# type: (...) -> None
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
super(AzureArcVMwareManagementServiceAPIConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2022-01-10-preview") # type: str

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(AzureArcVMwareManagementServiceAPIConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-10-01-preview"
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-connectedvmware/{}'.format(VERSION))
self._configure(**kwargs)
Expand All @@ -68,4 +70,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Loading