Skip to content

Commit

Permalink
CodeGen from PR 13814 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Anf 10997 NetApp Files update swagger rest api to 2021-02-01 (Azure#13814)

* Add api-version 2021-02-01 folder

* apply udpates

* Update readme

* update backaupStatus operationid

* Update account encryption settings

* Pretty

* Fix plural

* Add x-ms-pageable to AccountBackups_List

* change next link

* remove tag from backup proxy resource

* revert change to 2020-12

* remove tag from backup proxy resource

* Add x-ms-pageable to AccountBackups_List

* Pretty

* Add Snapshotpolicy to volumePatch

* Add Snapshotpolicy to volumeupdate example file

* Change subscription id in example

* Change subscription id in example

* pretty

* Remove AccountEncryption proptery, some non funcitonal validation warning fixes

* Fix example for backupoperators and securityoperators

* Remove readme.azureresourceschema.md

* Adding tags back to backuppatch, removing needs breaking change reivew

* fix prettier

Co-authored-by: Audunn Baldvinsson <audunn.baldvinsson@netapp.com>
  • Loading branch information
SDKAuto and audunn committed May 21, 2021
1 parent a98297f commit ebc45e0
Show file tree
Hide file tree
Showing 38 changed files with 901 additions and 696 deletions.
1 change: 1 addition & 0 deletions sdk/netapp/azure-mgmt-netapp/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/netapp/azure-mgmt-netapp/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.2",
"use": [
"@autorest/python@5.8.0",
"@autorest/modelerfour@4.19.1"
],
"commit": "20b168918d11ebeee6f00c71c0c41b93aae0ce0d",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/netapp/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.0 --use=@autorest/modelerfour@4.19.1 --version=3.4.2",
"readme": "specification/netapp/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-12-01"
self.api_version = "2021-02-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-netapp/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
69 changes: 55 additions & 14 deletions sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2020-12-01",
"total_api_version_list": ["2020-12-01"],
"chosen_version": "2021-02-01",
"total_api_version_list": ["2021-02-01"],
"client": {
"name": "NetAppManagementClient",
"filename": "_net_app_management_client",
Expand All @@ -9,7 +9,9 @@
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": 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\": [\"NetAppManagementClientConfiguration\"]}}, \"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\": [\"NetAppManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand All @@ -28,28 +30,72 @@
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"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, # type: str",
"signature": "subscription_id: str,",
"description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id"
"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
"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": {
"operations": "Operations",
Expand All @@ -59,14 +105,9 @@
"volumes": "VolumesOperations",
"snapshots": "SnapshotsOperations",
"snapshot_policies": "SnapshotPoliciesOperations",
"volume_backup_status": "VolumeBackupStatusOperations",
"account_backups": "AccountBackupsOperations",
"backups": "BackupsOperations",
"account_backups": "AccountBackupsOperations",
"backup_policies": "BackupPoliciesOperations",
"vaults": "VaultsOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
}
}
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 NetAppManagementClientConfiguration
from .operations import Operations
Expand All @@ -25,9 +26,8 @@
from .operations import VolumesOperations
from .operations import SnapshotsOperations
from .operations import SnapshotPoliciesOperations
from .operations import VolumeBackupStatusOperations
from .operations import AccountBackupsOperations
from .operations import BackupsOperations
from .operations import AccountBackupsOperations
from .operations import BackupPoliciesOperations
from .operations import VaultsOperations
from . import models
Expand All @@ -50,12 +50,10 @@ class NetAppManagementClient(object):
:vartype snapshots: azure.mgmt.netapp.operations.SnapshotsOperations
:ivar snapshot_policies: SnapshotPoliciesOperations operations
:vartype snapshot_policies: azure.mgmt.netapp.operations.SnapshotPoliciesOperations
:ivar volume_backup_status: VolumeBackupStatusOperations operations
:vartype volume_backup_status: azure.mgmt.netapp.operations.VolumeBackupStatusOperations
:ivar account_backups: AccountBackupsOperations operations
:vartype account_backups: azure.mgmt.netapp.operations.AccountBackupsOperations
:ivar backups: BackupsOperations operations
:vartype backups: azure.mgmt.netapp.operations.BackupsOperations
:ivar account_backups: AccountBackupsOperations operations
:vartype account_backups: azure.mgmt.netapp.operations.AccountBackupsOperations
:ivar backup_policies: BackupPoliciesOperations operations
:vartype backup_policies: azure.mgmt.netapp.operations.BackupPoliciesOperations
:ivar vaults: VaultsOperations operations
Expand Down Expand Up @@ -83,6 +81,7 @@ def __init__(

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.operations = Operations(
Expand All @@ -99,17 +98,33 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.snapshot_policies = SnapshotPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.volume_backup_status = VolumeBackupStatusOperations(
self.backups = BackupsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.account_backups = AccountBackupsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.backups = BackupsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.backup_policies = BackupPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.vaults = VaultsOperations(
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
2 changes: 1 addition & 1 deletion sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py
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 = "2.0.0"
VERSION = "1.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-12-01"
self.api_version = "2021-02-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-netapp/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
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 All @@ -23,9 +24,8 @@
from .operations import VolumesOperations
from .operations import SnapshotsOperations
from .operations import SnapshotPoliciesOperations
from .operations import VolumeBackupStatusOperations
from .operations import AccountBackupsOperations
from .operations import BackupsOperations
from .operations import AccountBackupsOperations
from .operations import BackupPoliciesOperations
from .operations import VaultsOperations
from .. import models
Expand All @@ -48,12 +48,10 @@ class NetAppManagementClient(object):
:vartype snapshots: azure.mgmt.netapp.aio.operations.SnapshotsOperations
:ivar snapshot_policies: SnapshotPoliciesOperations operations
:vartype snapshot_policies: azure.mgmt.netapp.aio.operations.SnapshotPoliciesOperations
:ivar volume_backup_status: VolumeBackupStatusOperations operations
:vartype volume_backup_status: azure.mgmt.netapp.aio.operations.VolumeBackupStatusOperations
:ivar account_backups: AccountBackupsOperations operations
:vartype account_backups: azure.mgmt.netapp.aio.operations.AccountBackupsOperations
:ivar backups: BackupsOperations operations
:vartype backups: azure.mgmt.netapp.aio.operations.BackupsOperations
:ivar account_backups: AccountBackupsOperations operations
:vartype account_backups: azure.mgmt.netapp.aio.operations.AccountBackupsOperations
:ivar backup_policies: BackupPoliciesOperations operations
:vartype backup_policies: azure.mgmt.netapp.aio.operations.BackupPoliciesOperations
:ivar vaults: VaultsOperations operations
Expand All @@ -80,6 +78,7 @@ def __init__(

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.operations = Operations(
Expand All @@ -96,17 +95,32 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.snapshot_policies = SnapshotPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.volume_backup_status = VolumeBackupStatusOperations(
self.backups = BackupsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.account_backups = AccountBackupsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.backups = BackupsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.backup_policies = BackupPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.vaults = VaultsOperations(
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 @@ -13,9 +13,8 @@
from ._volumes_operations import VolumesOperations
from ._snapshots_operations import SnapshotsOperations
from ._snapshot_policies_operations import SnapshotPoliciesOperations
from ._volume_backup_status_operations import VolumeBackupStatusOperations
from ._account_backups_operations import AccountBackupsOperations
from ._backups_operations import BackupsOperations
from ._account_backups_operations import AccountBackupsOperations
from ._backup_policies_operations import BackupPoliciesOperations
from ._vaults_operations import VaultsOperations

Expand All @@ -27,9 +26,8 @@
'VolumesOperations',
'SnapshotsOperations',
'SnapshotPoliciesOperations',
'VolumeBackupStatusOperations',
'AccountBackupsOperations',
'BackupsOperations',
'AccountBackupsOperations',
'BackupPoliciesOperations',
'VaultsOperations',
]

0 comments on commit ebc45e0

Please sign in to comment.