Skip to content
Closed
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
1 change: 1 addition & 0 deletions sdk/devtestlabs/azure-mgmt-devtestlabs/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
11 changes: 11 additions & 0 deletions sdk/devtestlabs/azure-mgmt-devtestlabs/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.5",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "6ba37b7279bbd0d69042743246780cc3af9257b9",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/devtestlabs/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/[email protected] --use=@autorest/[email protected] --version=3.4.5",
"readme": "specification/devtestlabs/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Optional

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

from ._configuration import DevTestLabsClientConfiguration
from .operations import ProviderOperationsOperations
Expand Down Expand Up @@ -176,6 +177,24 @@ def __init__(
self.virtual_networks = VirtualNetworksOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, 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.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.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

def close(self):
# type: () -> None
self._client.close()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"chosen_version": "2018-09-15",
"total_api_version_list": ["2018-09-15"],
"client": {
"name": "DevTestLabsClient",
"filename": "_dev_test_labs_client",
"description": "The DevTest Labs Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DevTestLabsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DevTestLabsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The subscription ID.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "The subscription ID.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"provider_operations": "ProviderOperationsOperations",
"labs": "LabsOperations",
"operations": "Operations",
"global_schedules": "GlobalSchedulesOperations",
"artifact_sources": "ArtifactSourcesOperations",
"arm_templates": "ArmTemplatesOperations",
"artifacts": "ArtifactsOperations",
"costs": "CostsOperations",
"custom_images": "CustomImagesOperations",
"formulas": "FormulasOperations",
"gallery_images": "GalleryImagesOperations",
"notification_channels": "NotificationChannelsOperations",
"policy_sets": "PolicySetsOperations",
"policies": "PoliciesOperations",
"schedules": "SchedulesOperations",
"service_runners": "ServiceRunnersOperations",
"users": "UsersOperations",
"disks": "DisksOperations",
"environments": "EnvironmentsOperations",
"secrets": "SecretsOperations",
"service_fabrics": "ServiceFabricsOperations",
"service_fabric_schedules": "ServiceFabricSchedulesOperations",
"virtual_machines": "VirtualMachinesOperations",
"virtual_machine_schedules": "VirtualMachineSchedulesOperations",
"virtual_networks": "VirtualNetworksOperations"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "9.0.0"
VERSION = "1.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand Down Expand Up @@ -173,6 +174,23 @@ def __init__(
self.virtual_networks = VirtualNetworksOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""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.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
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 = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def list(
filter: Optional[str] = None,
top: Optional[int] = None,
orderby: Optional[str] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.ArmTemplateList"]:
"""List azure resource manager templates in a given artifact source.

Expand Down Expand Up @@ -147,7 +147,7 @@ async def get(
artifact_source_name: str,
name: str,
expand: Optional[str] = None,
**kwargs
**kwargs: Any
) -> "_models.ArmTemplate":
"""Get azure resource manager template.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def list(
filter: Optional[str] = None,
top: Optional[int] = None,
orderby: Optional[str] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.ArtifactSourceList"]:
"""List artifact sources in a given lab.

Expand Down Expand Up @@ -142,7 +142,7 @@ async def get(
lab_name: str,
name: str,
expand: Optional[str] = None,
**kwargs
**kwargs: Any
) -> "_models.ArtifactSource":
"""Get artifact source.

Expand Down Expand Up @@ -209,7 +209,7 @@ async def create_or_update(
lab_name: str,
name: str,
artifact_source: "_models.ArtifactSource",
**kwargs
**kwargs: Any
) -> "_models.ArtifactSource":
"""Create or replace an existing artifact source.

Expand Down Expand Up @@ -282,7 +282,7 @@ async def delete(
resource_group_name: str,
lab_name: str,
name: str,
**kwargs
**kwargs: Any
) -> None:
"""Delete artifact source.

Expand Down Expand Up @@ -341,8 +341,8 @@ async def update(
resource_group_name: str,
lab_name: str,
name: str,
artifact_source: "_models.ArtifactSourceFragment",
**kwargs
tags: Optional[Dict[str, str]] = None,
**kwargs: Any
) -> "_models.ArtifactSource":
"""Allows modifying tags of artifact sources. All other properties will be ignored.

Expand All @@ -352,8 +352,8 @@ async def update(
:type lab_name: str
:param name: The name of the artifact source.
:type name: str
:param artifact_source: Properties of an artifact source.
:type artifact_source: ~azure.mgmt.devtestlabs.models.ArtifactSourceFragment
:param tags: The tags of the resource.
:type tags: dict[str, str]
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ArtifactSource, or the result of cls(response)
:rtype: ~azure.mgmt.devtestlabs.models.ArtifactSource
Expand All @@ -364,6 +364,8 @@ async def update(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))

_artifact_source = _models.ArtifactSourceFragment(tags=tags)
api_version = "2018-09-15"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
Expand All @@ -388,7 +390,7 @@ async def update(
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(artifact_source, 'ArtifactSourceFragment')
body_content = self._serialize.body(_artifact_source, 'ArtifactSourceFragment')
body_content_kwargs['content'] = body_content
request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def list(
filter: Optional[str] = None,
top: Optional[int] = None,
orderby: Optional[str] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.ArtifactList"]:
"""List artifacts in a given artifact source.

Expand Down Expand Up @@ -147,7 +147,7 @@ async def get(
artifact_source_name: str,
name: str,
expand: Optional[str] = None,
**kwargs
**kwargs: Any
) -> "_models.Artifact":
"""Get artifact.

Expand Down Expand Up @@ -218,7 +218,7 @@ async def generate_arm_template(
artifact_source_name: str,
name: str,
generate_arm_template_request: "_models.GenerateArmTemplateRequest",
**kwargs
**kwargs: Any
) -> "_models.ArmTemplateInfo":
"""Generates an ARM template for the given artifact, uploads the required files to a storage
account, and validates the generated artifact.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def get(
lab_name: str,
name: str,
expand: Optional[str] = None,
**kwargs
**kwargs: Any
) -> "_models.LabCost":
"""Get cost.

Expand Down Expand Up @@ -113,7 +113,7 @@ async def create_or_update(
lab_name: str,
name: str,
lab_cost: "_models.LabCost",
**kwargs
**kwargs: Any
) -> "_models.LabCost":
"""Create or replace an existing cost.

Expand Down
Loading