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

[ReleasePR azure-mgmt-appplatform] Azure Spring Cloud: Add location to Apps #10620

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 @@ -93,8 +93,8 @@
TestKeyType,
AppResourceProvisioningState,
UserSourceType,
DeploymentResourceProvisioningState,
RuntimeVersion,
DeploymentResourceProvisioningState,
DeploymentResourceStatus,
)

Expand Down Expand Up @@ -145,7 +145,7 @@
'TestKeyType',
'AppResourceProvisioningState',
'UserSourceType',
'DeploymentResourceProvisioningState',
'RuntimeVersion',
'DeploymentResourceProvisioningState',
'DeploymentResourceStatus',
]
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ class UserSourceType(str, Enum):
source = "Source"


class RuntimeVersion(str, Enum):

java_8 = "Java_8"
java_11 = "Java_11"


class DeploymentResourceProvisioningState(str, Enum):

creating = "Creating"
Expand All @@ -70,12 +76,6 @@ class DeploymentResourceProvisioningState(str, Enum):
failed = "Failed"


class RuntimeVersion(str, Enum):

java_8 = "Java_8"
java_11 = "Java_11"


class DeploymentResourceStatus(str, Enum):

unknown = "Unknown"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class AppResource(ProxyResource):
:vartype type: str
:param properties: Properties of the App resource
:type properties: ~azure.mgmt.appplatform.models.AppResourceProperties
:param location: The GEO location of the application, always the same with
its parent resource
:type location: str
"""

_validation = {
Expand All @@ -104,11 +107,13 @@ class AppResource(ProxyResource):
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'AppResourceProperties'},
'location': {'key': 'location', 'type': 'str'},
}

def __init__(self, **kwargs):
super(AppResource, self).__init__(**kwargs)
self.properties = kwargs.get('properties', None)
self.location = kwargs.get('location', None)


class AppResourceProperties(Model):
Expand Down Expand Up @@ -547,13 +552,13 @@ class DeploymentResourceProperties(Model):
:type source: ~azure.mgmt.appplatform.models.UserSourceInfo
:ivar app_name: App name of the deployment
:vartype app_name: str
:param deployment_settings: Deployment settings of the Deployment
:type deployment_settings:
~azure.mgmt.appplatform.models.DeploymentSettings
:ivar provisioning_state: Provisioning state of the Deployment. Possible
values include: 'Creating', 'Updating', 'Succeeded', 'Failed'
:vartype provisioning_state: str or
~azure.mgmt.appplatform.models.DeploymentResourceProvisioningState
:param deployment_settings: Deployment settings of the Deployment
:type deployment_settings:
~azure.mgmt.appplatform.models.DeploymentSettings
:ivar status: Status of the Deployment. Possible values include:
'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading',
'Compiling'
Expand All @@ -580,8 +585,8 @@ class DeploymentResourceProperties(Model):
_attribute_map = {
'source': {'key': 'source', 'type': 'UserSourceInfo'},
'app_name': {'key': 'appName', 'type': 'str'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'deployment_settings': {'key': 'deploymentSettings', 'type': 'DeploymentSettings'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'status': {'key': 'status', 'type': 'str'},
'active': {'key': 'active', 'type': 'bool'},
'created_time': {'key': 'createdTime', 'type': 'iso-8601'},
Expand All @@ -592,8 +597,8 @@ def __init__(self, **kwargs):
super(DeploymentResourceProperties, self).__init__(**kwargs)
self.source = kwargs.get('source', None)
self.app_name = None
self.provisioning_state = None
self.deployment_settings = kwargs.get('deployment_settings', None)
self.provisioning_state = None
self.status = None
self.active = None
self.created_time = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class AppResource(ProxyResource):
:vartype type: str
:param properties: Properties of the App resource
:type properties: ~azure.mgmt.appplatform.models.AppResourceProperties
:param location: The GEO location of the application, always the same with
its parent resource
:type location: str
"""

_validation = {
Expand All @@ -104,11 +107,13 @@ class AppResource(ProxyResource):
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'AppResourceProperties'},
'location': {'key': 'location', 'type': 'str'},
}

def __init__(self, *, properties=None, **kwargs) -> None:
def __init__(self, *, properties=None, location: str=None, **kwargs) -> None:
super(AppResource, self).__init__(**kwargs)
self.properties = properties
self.location = location


class AppResourceProperties(Model):
Expand Down Expand Up @@ -547,13 +552,13 @@ class DeploymentResourceProperties(Model):
:type source: ~azure.mgmt.appplatform.models.UserSourceInfo
:ivar app_name: App name of the deployment
:vartype app_name: str
:param deployment_settings: Deployment settings of the Deployment
:type deployment_settings:
~azure.mgmt.appplatform.models.DeploymentSettings
:ivar provisioning_state: Provisioning state of the Deployment. Possible
values include: 'Creating', 'Updating', 'Succeeded', 'Failed'
:vartype provisioning_state: str or
~azure.mgmt.appplatform.models.DeploymentResourceProvisioningState
:param deployment_settings: Deployment settings of the Deployment
:type deployment_settings:
~azure.mgmt.appplatform.models.DeploymentSettings
:ivar status: Status of the Deployment. Possible values include:
'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading',
'Compiling'
Expand All @@ -580,8 +585,8 @@ class DeploymentResourceProperties(Model):
_attribute_map = {
'source': {'key': 'source', 'type': 'UserSourceInfo'},
'app_name': {'key': 'appName', 'type': 'str'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'deployment_settings': {'key': 'deploymentSettings', 'type': 'DeploymentSettings'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'status': {'key': 'status', 'type': 'str'},
'active': {'key': 'active', 'type': 'bool'},
'created_time': {'key': 'createdTime', 'type': 'iso-8601'},
Expand All @@ -592,8 +597,8 @@ def __init__(self, *, source=None, deployment_settings=None, **kwargs) -> None:
super(DeploymentResourceProperties, self).__init__(**kwargs)
self.source = source
self.app_name = None
self.provisioning_state = None
self.deployment_settings = deployment_settings
self.provisioning_state = None
self.status = None
self.active = None
self.created_time = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def get(

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if sync_status is not None:
query_parameters['syncStatus'] = self._serialize.query("sync_status", sync_status, 'str')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
Expand Down Expand Up @@ -113,10 +113,8 @@ def get(


def _create_or_update_initial(
self, resource_group_name, service_name, app_name, properties=None, custom_headers=None, raw=False, **operation_config):
app_resource = None
if properties is not None:
app_resource = models.AppResource(properties=properties)
self, resource_group_name, service_name, app_name, properties=None, location=None, custom_headers=None, raw=False, **operation_config):
app_resource = models.AppResource(properties=properties, location=location)

# Construct URL
url = self.create_or_update.metadata['url']
Expand Down Expand Up @@ -144,10 +142,7 @@ def _create_or_update_initial(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
if app_resource is not None:
body_content = self._serialize.body(app_resource, 'AppResource')
else:
body_content = None
body_content = self._serialize.body(app_resource, 'AppResource')

# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
Expand All @@ -172,7 +167,7 @@ def _create_or_update_initial(
return deserialized

def create_or_update(
self, resource_group_name, service_name, app_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config):
self, resource_group_name, service_name, app_name, properties=None, location=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Create a new App or update an exiting App.

:param resource_group_name: The name of the resource group that
Expand All @@ -185,6 +180,9 @@ def create_or_update(
:type app_name: str
:param properties: Properties of the App resource
:type properties: ~azure.mgmt.appplatform.models.AppResourceProperties
:param location: The GEO location of the application, always the same
with its parent resource
:type location: 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
Expand All @@ -203,6 +201,7 @@ def create_or_update(
service_name=service_name,
app_name=app_name,
properties=properties,
location=location,
custom_headers=custom_headers,
raw=True,
**operation_config
Expand Down Expand Up @@ -286,10 +285,8 @@ def delete(


def _update_initial(
self, resource_group_name, service_name, app_name, properties=None, custom_headers=None, raw=False, **operation_config):
app_resource = None
if properties is not None:
app_resource = models.AppResource(properties=properties)
self, resource_group_name, service_name, app_name, properties=None, location=None, custom_headers=None, raw=False, **operation_config):
app_resource = models.AppResource(properties=properties, location=location)

# Construct URL
url = self.update.metadata['url']
Expand Down Expand Up @@ -317,10 +314,7 @@ def _update_initial(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
if app_resource is not None:
body_content = self._serialize.body(app_resource, 'AppResource')
else:
body_content = None
body_content = self._serialize.body(app_resource, 'AppResource')

# Construct and send request
request = self._client.patch(url, query_parameters, header_parameters, body_content)
Expand All @@ -345,7 +339,7 @@ def _update_initial(
return deserialized

def update(
self, resource_group_name, service_name, app_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config):
self, resource_group_name, service_name, app_name, properties=None, location=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Operation to update an exiting App.

:param resource_group_name: The name of the resource group that
Expand All @@ -358,6 +352,9 @@ def update(
:type app_name: str
:param properties: Properties of the App resource
:type properties: ~azure.mgmt.appplatform.models.AppResourceProperties
:param location: The GEO location of the application, always the same
with its parent resource
:type location: 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
Expand All @@ -376,6 +373,7 @@ def update(
service_name=service_name,
app_name=app_name,
properties=properties,
location=location,
custom_headers=custom_headers,
raw=True,
**operation_config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ def create_or_update(
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
binding_resource = None
if properties is not None:
binding_resource = models.BindingResource(properties=properties)
binding_resource = models.BindingResource(properties=properties)

# Construct URL
url = self.create_or_update.metadata['url']
Expand Down Expand Up @@ -166,10 +164,7 @@ def create_or_update(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
if binding_resource is not None:
body_content = self._serialize.body(binding_resource, 'BindingResource')
else:
body_content = None
body_content = self._serialize.body(binding_resource, 'BindingResource')

# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
Expand Down Expand Up @@ -279,9 +274,7 @@ def update(
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
binding_resource = None
if properties is not None:
binding_resource = models.BindingResource(properties=properties)
binding_resource = models.BindingResource(properties=properties)

# Construct URL
url = self.update.metadata['url']
Expand Down Expand Up @@ -310,10 +303,7 @@ def update(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
if binding_resource is not None:
body_content = self._serialize.body(binding_resource, 'BindingResource')
else:
body_content = None
body_content = self._serialize.body(binding_resource, 'BindingResource')

# Construct and send request
request = self._client.patch(url, query_parameters, header_parameters, body_content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ def get(

def _create_or_update_initial(
self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, **operation_config):
deployment_resource = None
if properties is not None:
deployment_resource = models.DeploymentResource(properties=properties)
deployment_resource = models.DeploymentResource(properties=properties)

# Construct URL
url = self.create_or_update.metadata['url']
Expand Down Expand Up @@ -144,10 +142,7 @@ def _create_or_update_initial(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
if deployment_resource is not None:
body_content = self._serialize.body(deployment_resource, 'DeploymentResource')
else:
body_content = None
body_content = self._serialize.body(deployment_resource, 'DeploymentResource')

# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
Expand Down Expand Up @@ -294,9 +289,7 @@ def delete(

def _update_initial(
self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, **operation_config):
deployment_resource = None
if properties is not None:
deployment_resource = models.DeploymentResource(properties=properties)
deployment_resource = models.DeploymentResource(properties=properties)

# Construct URL
url = self.update.metadata['url']
Expand Down Expand Up @@ -325,10 +318,7 @@ def _update_initial(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
if deployment_resource is not None:
body_content = self._serialize.body(deployment_resource, 'DeploymentResource')
else:
body_content = None
body_content = self._serialize.body(deployment_resource, 'DeploymentResource')

# Construct and send request
request = self._client.patch(url, query_parameters, header_parameters, body_content)
Expand Down Expand Up @@ -449,9 +439,9 @@ def prepare_request(next_link=None):

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if version is not None:
query_parameters['version'] = self._serialize.query("version", version, '[str]', div=',')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

else:
url = next_link
Expand Down Expand Up @@ -527,9 +517,9 @@ def prepare_request(next_link=None):

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if version is not None:
query_parameters['version'] = self._serialize.query("version", version, '[str]', div=',')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

else:
url = next_link
Expand Down
Loading