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

Update SDK #23

Closed
wants to merge 3 commits into from
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
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def validate_buildpacks_binding_not_exist(cmd, namespace):
if binding_resource is not None:
raise CLIError('Buildpacks Binding {} already exists '
'in resource group {}, service {}. You can edit it by set command.'
.format(binding_name, resource_group, service))
.format(namespace.name, namespace.resource_group, namespace.service))
except ResourceNotFoundError:
# Excepted case
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from .operations import ConfigServersOperations
from .operations import ConfigurationServicesOperations
from .operations import ServiceRegistriesOperations
from .operations import ServiceOperations
from .operations import BuildServiceOperations
from .operations import BuildpacksBindingOperations
from .operations import MonitoringSettingsOperations
Expand All @@ -49,8 +48,6 @@ class AppPlatformManagementClient(object):
:vartype configuration_services: azure.mgmt.appplatform.v2022_05_01_preview.operations.ConfigurationServicesOperations
:ivar service_registries: ServiceRegistriesOperations operations
:vartype service_registries: azure.mgmt.appplatform.v2022_05_01_preview.operations.ServiceRegistriesOperations
:ivar service: ServiceOperations operations
:vartype service: azure.mgmt.appplatform.v2022_05_01_preview.operations.ServiceOperations
:ivar build_service: BuildServiceOperations operations
:vartype build_service: azure.mgmt.appplatform.v2022_05_01_preview.operations.BuildServiceOperations
:ivar buildpacks_binding: BuildpacksBindingOperations operations
Expand Down Expand Up @@ -107,8 +104,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.service_registries = ServiceRegistriesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.service = ServiceOperations(
self._client, self._config, self._serialize, self._deserialize)
self.build_service = BuildServiceOperations(
self._client, self._config, self._serialize, self._deserialize)
self.buildpacks_binding = BuildpacksBindingOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from .operations import ConfigServersOperations
from .operations import ConfigurationServicesOperations
from .operations import ServiceRegistriesOperations
from .operations import ServiceOperations
from .operations import BuildServiceOperations
from .operations import BuildpacksBindingOperations
from .operations import MonitoringSettingsOperations
Expand All @@ -47,8 +46,6 @@ class AppPlatformManagementClient(object):
:vartype configuration_services: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.ConfigurationServicesOperations
:ivar service_registries: ServiceRegistriesOperations operations
:vartype service_registries: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.ServiceRegistriesOperations
:ivar service: ServiceOperations operations
:vartype service: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.ServiceOperations
:ivar build_service: BuildServiceOperations operations
:vartype build_service: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.BuildServiceOperations
:ivar buildpacks_binding: BuildpacksBindingOperations operations
Expand Down Expand Up @@ -104,8 +101,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.service_registries = ServiceRegistriesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.service = ServiceOperations(
self._client, self._config, self._serialize, self._deserialize)
self.build_service = BuildServiceOperations(
self._client, self._config, self._serialize, self._deserialize)
self.buildpacks_binding = BuildpacksBindingOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from ._config_servers_operations import ConfigServersOperations
from ._configuration_services_operations import ConfigurationServicesOperations
from ._service_registries_operations import ServiceRegistriesOperations
from ._service_operations import ServiceOperations
from ._build_service_operations import BuildServiceOperations
from ._buildpacks_binding_operations import BuildpacksBindingOperations
from ._monitoring_settings_operations import MonitoringSettingsOperations
Expand All @@ -28,7 +27,6 @@
'ConfigServersOperations',
'ConfigurationServicesOperations',
'ServiceRegistriesOperations',
'ServiceOperations',
'BuildServiceOperations',
'BuildpacksBindingOperations',
'MonitoringSettingsOperations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ async def _validate_initial(
self,
resource_group_name: str,
service_name: str,
configuration_service_settings: "_models.ConfigurationServiceSettings",
settings: "_models.ConfigurationServiceSettings",
**kwargs: Any
) -> "_models.ConfigurationServiceSettingsValidateResult":
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationServiceSettingsValidateResult"]
Expand Down Expand Up @@ -378,7 +378,7 @@ async def _validate_initial(
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(configuration_service_settings, 'ConfigurationServiceSettings')
body_content = self._serialize.body(settings, 'ConfigurationServiceSettings')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
Expand All @@ -404,7 +404,7 @@ async def begin_validate(
self,
resource_group_name: str,
service_name: str,
configuration_service_settings: "_models.ConfigurationServiceSettings",
settings: "_models.ConfigurationServiceSettings",
**kwargs: Any
) -> AsyncLROPoller["_models.ConfigurationServiceSettingsValidateResult"]:
"""Check if the Application Configuration Service settings are valid.
Expand All @@ -414,9 +414,8 @@ async def begin_validate(
:type resource_group_name: str
:param service_name: The name of the Service resource.
:type service_name: str
:param configuration_service_settings: Application Configuration Service settings to be
validated.
:type configuration_service_settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings
:param settings: Application Configuration Service settings to be validated.
:type settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling.
Expand All @@ -438,7 +437,7 @@ async def begin_validate(
raw_result = await self._validate_initial(
resource_group_name=resource_group_name,
service_name=service_name,
configuration_service_settings=configuration_service_settings,
settings=settings,
cls=lambda x,y,z: x,
**kwargs
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,112 @@ def get_long_running_output(pipeline_response):
else:
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore

async def _delete_initial(
self,
resource_group_name: str,
service_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2022-05-01-preview"
accept = "application/json"

# Construct URL
url = self._delete_initial.metadata['url'] # type: ignore
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'),
'serviceName': self._serialize.url("service_name", service_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)

if cls:
return cls(pipeline_response, None, {})

_delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore

async def begin_delete(
self,
resource_group_name: str,
service_name: str,
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Disable the default Service Registry.

:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal.
:type resource_group_name: str
:param service_name: The name of the Service resource.
:type service_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = await self._delete_initial(
resource_group_name=resource_group_name,
service_name=service_name,
cls=lambda x,y,z: x,
**kwargs
)

kwargs.pop('error_map', None)
kwargs.pop('content_type', None)

def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})

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'),
'serviceName': self._serialize.url("service_name", service_name, 'str'),
}

if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -1651,21 +1651,21 @@ def __init__(
class ConfigurationServiceSettingsValidateResult(msrest.serialization.Model):
"""Validation result for configuration service settings.

:param git_property_validate_result: Validation result for configuration service settings.
:type git_property_validate_result:
:param git_property_validation_result: Validation result for configuration service settings.
:type git_property_validation_result:
~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceGitPropertyValidateResult
"""

_attribute_map = {
'git_property_validate_result': {'key': 'gitPropertyValidateResult', 'type': 'ConfigurationServiceGitPropertyValidateResult'},
'git_property_validation_result': {'key': 'gitPropertyValidationResult', 'type': 'ConfigurationServiceGitPropertyValidateResult'},
}

def __init__(
self,
**kwargs
):
super(ConfigurationServiceSettingsValidateResult, self).__init__(**kwargs)
self.git_property_validate_result = kwargs.get('git_property_validate_result', None)
self.git_property_validation_result = kwargs.get('git_property_validation_result', None)


class CustomContainer(UserSourceInfo):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1791,23 +1791,23 @@ def __init__(
class ConfigurationServiceSettingsValidateResult(msrest.serialization.Model):
"""Validation result for configuration service settings.

:param git_property_validate_result: Validation result for configuration service settings.
:type git_property_validate_result:
:param git_property_validation_result: Validation result for configuration service settings.
:type git_property_validation_result:
~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceGitPropertyValidateResult
"""

_attribute_map = {
'git_property_validate_result': {'key': 'gitPropertyValidateResult', 'type': 'ConfigurationServiceGitPropertyValidateResult'},
'git_property_validation_result': {'key': 'gitPropertyValidationResult', 'type': 'ConfigurationServiceGitPropertyValidateResult'},
}

def __init__(
self,
*,
git_property_validate_result: Optional["ConfigurationServiceGitPropertyValidateResult"] = None,
git_property_validation_result: Optional["ConfigurationServiceGitPropertyValidateResult"] = None,
**kwargs
):
super(ConfigurationServiceSettingsValidateResult, self).__init__(**kwargs)
self.git_property_validate_result = git_property_validate_result
self.git_property_validation_result = git_property_validation_result


class CustomContainer(UserSourceInfo):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from ._config_servers_operations import ConfigServersOperations
from ._configuration_services_operations import ConfigurationServicesOperations
from ._service_registries_operations import ServiceRegistriesOperations
from ._service_operations import ServiceOperations
from ._build_service_operations import BuildServiceOperations
from ._buildpacks_binding_operations import BuildpacksBindingOperations
from ._monitoring_settings_operations import MonitoringSettingsOperations
Expand All @@ -28,7 +27,6 @@
'ConfigServersOperations',
'ConfigurationServicesOperations',
'ServiceRegistriesOperations',
'ServiceOperations',
'BuildServiceOperations',
'BuildpacksBindingOperations',
'MonitoringSettingsOperations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def _validate_initial(
self,
resource_group_name, # type: str
service_name, # type: str
configuration_service_settings, # type: "_models.ConfigurationServiceSettings"
settings, # type: "_models.ConfigurationServiceSettings"
**kwargs # type: Any
):
# type: (...) -> "_models.ConfigurationServiceSettingsValidateResult"
Expand Down Expand Up @@ -388,7 +388,7 @@ def _validate_initial(
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(configuration_service_settings, 'ConfigurationServiceSettings')
body_content = self._serialize.body(settings, 'ConfigurationServiceSettings')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
Expand All @@ -414,7 +414,7 @@ def begin_validate(
self,
resource_group_name, # type: str
service_name, # type: str
configuration_service_settings, # type: "_models.ConfigurationServiceSettings"
settings, # type: "_models.ConfigurationServiceSettings"
**kwargs # type: Any
):
# type: (...) -> LROPoller["_models.ConfigurationServiceSettingsValidateResult"]
Expand All @@ -425,9 +425,8 @@ def begin_validate(
:type resource_group_name: str
:param service_name: The name of the Service resource.
:type service_name: str
:param configuration_service_settings: Application Configuration Service settings to be
validated.
:type configuration_service_settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings
:param settings: Application Configuration Service settings to be validated.
:type settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling.
Expand All @@ -449,7 +448,7 @@ def begin_validate(
raw_result = self._validate_initial(
resource_group_name=resource_group_name,
service_name=service_name,
configuration_service_settings=configuration_service_settings,
settings=settings,
cls=lambda x,y,z: x,
**kwargs
)
Expand Down
Loading