Skip to content

Commit 1fe3d58

Browse files
author
SDK Automation
committed
Generated from 6c86b7792545dac7f6807118b1e6d874e2614677
rename ManagedClusterVersions to differentiate with non-managed model
1 parent 459bc74 commit 1fe3d58

File tree

6 files changed

+130
-92
lines changed

6 files changed

+130
-92
lines changed

sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_service_fabric_management_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from .operations import ApplicationsOperations
2222
from .operations import ServicesOperations
2323
from .operations import ManagedClustersOperations
24+
from .operations import ManagedClusterVersionsOperations
2425
from .operations import NodeTypesOperations
2526
from . import models
2627

@@ -47,6 +48,8 @@ class ServiceFabricManagementClient(SDKClient):
4748
:vartype services: azure.mgmt.servicefabric.operations.ServicesOperations
4849
:ivar managed_clusters: ManagedClusters operations
4950
:vartype managed_clusters: azure.mgmt.servicefabric.operations.ManagedClustersOperations
51+
:ivar managed_cluster_versions: ManagedClusterVersions operations
52+
:vartype managed_cluster_versions: azure.mgmt.servicefabric.operations.ManagedClusterVersionsOperations
5053
:ivar node_types: NodeTypes operations
5154
:vartype node_types: azure.mgmt.servicefabric.operations.NodeTypesOperations
5255
@@ -84,5 +87,7 @@ def __init__(
8487
self._client, self.config, self._serialize, self._deserialize)
8588
self.managed_clusters = ManagedClustersOperations(
8689
self._client, self.config, self._serialize, self._deserialize)
90+
self.managed_cluster_versions = ManagedClusterVersionsOperations(
91+
self._client, self.config, self._serialize, self._deserialize)
8792
self.node_types = NodeTypesOperations(
8893
self._client, self.config, self._serialize, self._deserialize)

sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,9 +2329,9 @@ class NodeType(ManagedProxyResource):
23292329
This count should match the capacity property in the corresponding
23302330
VirtualMachineScaleSet resource.
23312331
:type vm_instance_count: int
2332-
:param disk_size_in_gb: Required. Disk size for each vm in the node type
2332+
:param data_disk_size_gb: Required. Disk size for each vm in the node type
23332333
in GBs.
2334-
:type disk_size_in_gb: int
2334+
:type data_disk_size_gb: int
23352335
:param placement_properties: The placement tags applied to nodes in the
23362336
node type, which can be used to indicate where certain services (workload)
23372337
should run.
@@ -2383,7 +2383,7 @@ class NodeType(ManagedProxyResource):
23832383
'type': {'readonly': True},
23842384
'is_primary': {'required': True},
23852385
'vm_instance_count': {'required': True, 'maximum': 2147483647, 'minimum': 1},
2386-
'disk_size_in_gb': {'required': True},
2386+
'data_disk_size_gb': {'required': True},
23872387
'provisioning_state': {'readonly': True},
23882388
}
23892389

@@ -2394,7 +2394,7 @@ class NodeType(ManagedProxyResource):
23942394
'tags': {'key': 'tags', 'type': '{str}'},
23952395
'is_primary': {'key': 'properties.isPrimary', 'type': 'bool'},
23962396
'vm_instance_count': {'key': 'properties.vmInstanceCount', 'type': 'int'},
2397-
'disk_size_in_gb': {'key': 'properties.diskSizeInGB', 'type': 'int'},
2397+
'data_disk_size_gb': {'key': 'properties.dataDiskSizeGB', 'type': 'int'},
23982398
'placement_properties': {'key': 'properties.placementProperties', 'type': '{str}'},
23992399
'capacities': {'key': 'properties.capacities', 'type': '{str}'},
24002400
'application_ports': {'key': 'properties.applicationPorts', 'type': 'EndpointRangeDescription'},
@@ -2413,7 +2413,7 @@ def __init__(self, **kwargs):
24132413
super(NodeType, self).__init__(**kwargs)
24142414
self.is_primary = kwargs.get('is_primary', None)
24152415
self.vm_instance_count = kwargs.get('vm_instance_count', None)
2416-
self.disk_size_in_gb = kwargs.get('disk_size_in_gb', None)
2416+
self.data_disk_size_gb = kwargs.get('data_disk_size_gb', None)
24172417
self.placement_properties = kwargs.get('placement_properties', None)
24182418
self.capacities = kwargs.get('capacities', None)
24192419
self.application_ports = kwargs.get('application_ports', None)

sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models_py3.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,9 +2329,9 @@ class NodeType(ManagedProxyResource):
23292329
This count should match the capacity property in the corresponding
23302330
VirtualMachineScaleSet resource.
23312331
:type vm_instance_count: int
2332-
:param disk_size_in_gb: Required. Disk size for each vm in the node type
2332+
:param data_disk_size_gb: Required. Disk size for each vm in the node type
23332333
in GBs.
2334-
:type disk_size_in_gb: int
2334+
:type data_disk_size_gb: int
23352335
:param placement_properties: The placement tags applied to nodes in the
23362336
node type, which can be used to indicate where certain services (workload)
23372337
should run.
@@ -2383,7 +2383,7 @@ class NodeType(ManagedProxyResource):
23832383
'type': {'readonly': True},
23842384
'is_primary': {'required': True},
23852385
'vm_instance_count': {'required': True, 'maximum': 2147483647, 'minimum': 1},
2386-
'disk_size_in_gb': {'required': True},
2386+
'data_disk_size_gb': {'required': True},
23872387
'provisioning_state': {'readonly': True},
23882388
}
23892389

@@ -2394,7 +2394,7 @@ class NodeType(ManagedProxyResource):
23942394
'tags': {'key': 'tags', 'type': '{str}'},
23952395
'is_primary': {'key': 'properties.isPrimary', 'type': 'bool'},
23962396
'vm_instance_count': {'key': 'properties.vmInstanceCount', 'type': 'int'},
2397-
'disk_size_in_gb': {'key': 'properties.diskSizeInGB', 'type': 'int'},
2397+
'data_disk_size_gb': {'key': 'properties.dataDiskSizeGB', 'type': 'int'},
23982398
'placement_properties': {'key': 'properties.placementProperties', 'type': '{str}'},
23992399
'capacities': {'key': 'properties.capacities', 'type': '{str}'},
24002400
'application_ports': {'key': 'properties.applicationPorts', 'type': 'EndpointRangeDescription'},
@@ -2409,11 +2409,11 @@ class NodeType(ManagedProxyResource):
24092409
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
24102410
}
24112411

2412-
def __init__(self, *, is_primary: bool, vm_instance_count: int, disk_size_in_gb: int, tags=None, placement_properties=None, capacities=None, application_ports=None, ephemeral_ports=None, vm_size: str=None, vm_image_publisher: str=None, vm_image_offer: str=None, vm_image_sku: str=None, vm_image_version: str=None, vm_secrets=None, vm_extensions=None, **kwargs) -> None:
2412+
def __init__(self, *, is_primary: bool, vm_instance_count: int, data_disk_size_gb: int, tags=None, placement_properties=None, capacities=None, application_ports=None, ephemeral_ports=None, vm_size: str=None, vm_image_publisher: str=None, vm_image_offer: str=None, vm_image_sku: str=None, vm_image_version: str=None, vm_secrets=None, vm_extensions=None, **kwargs) -> None:
24132413
super(NodeType, self).__init__(tags=tags, **kwargs)
24142414
self.is_primary = is_primary
24152415
self.vm_instance_count = vm_instance_count
2416-
self.disk_size_in_gb = disk_size_in_gb
2416+
self.data_disk_size_gb = data_disk_size_gb
24172417
self.placement_properties = placement_properties
24182418
self.capacities = capacities
24192419
self.application_ports = application_ports

sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from ._applications_operations import ApplicationsOperations
1818
from ._services_operations import ServicesOperations
1919
from ._managed_clusters_operations import ManagedClustersOperations
20+
from ._managed_cluster_versions_operations import ManagedClusterVersionsOperations
2021
from ._node_types_operations import NodeTypesOperations
2122

2223
__all__ = [
@@ -28,5 +29,6 @@
2829
'ApplicationsOperations',
2930
'ServicesOperations',
3031
'ManagedClustersOperations',
32+
'ManagedClusterVersionsOperations',
3133
'NodeTypesOperations',
3234
]

sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_cluster_versions_operations.py

Lines changed: 6 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ClusterVersionsOperations(object):
2525
:param config: Configuration of service client.
2626
:param serializer: An object model serializer.
2727
:param deserializer: An object model deserializer.
28+
:ivar api_version: The version of the Service Fabric resource provider API. This is a required parameter and it's value must be "2020-03-01" for this specification. Constant value: "2020-03-01".
2829
"""
2930

3031
models = models
@@ -34,6 +35,7 @@ def __init__(self, client, config, serializer, deserializer):
3435
self._client = client
3536
self._serialize = serializer
3637
self._deserialize = deserializer
38+
self.api_version = "2020-03-01"
3739

3840
self.config = config
3941

@@ -61,8 +63,6 @@ def get(
6163
or ~msrest.pipeline.ClientRawResponse
6264
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
6365
"""
64-
api_version = "2020-03-01"
65-
6666
# Construct URL
6767
url = self.get.metadata['url']
6868
path_format_arguments = {
@@ -74,7 +74,7 @@ def get(
7474

7575
# Construct parameters
7676
query_parameters = {}
77-
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
77+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
7878

7979
# Construct headers
8080
header_parameters = {}
@@ -133,8 +133,6 @@ def get_by_environment(
133133
or ~msrest.pipeline.ClientRawResponse
134134
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
135135
"""
136-
api_version = "2020-03-01"
137-
138136
# Construct URL
139137
url = self.get_by_environment.metadata['url']
140138
path_format_arguments = {
@@ -147,7 +145,7 @@ def get_by_environment(
147145

148146
# Construct parameters
149147
query_parameters = {}
150-
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
148+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
151149

152150
# Construct headers
153151
header_parameters = {}
@@ -201,8 +199,6 @@ def list(
201199
or ~msrest.pipeline.ClientRawResponse
202200
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
203201
"""
204-
api_version = "2020-03-01"
205-
206202
# Construct URL
207203
url = self.list.metadata['url']
208204
path_format_arguments = {
@@ -213,7 +209,7 @@ def list(
213209

214210
# Construct parameters
215211
query_parameters = {}
216-
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
212+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
217213

218214
# Construct headers
219215
header_parameters = {}
@@ -270,8 +266,6 @@ def list_by_environment(
270266
or ~msrest.pipeline.ClientRawResponse
271267
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
272268
"""
273-
api_version = "2020-03-01"
274-
275269
# Construct URL
276270
url = self.list_by_environment.metadata['url']
277271
path_format_arguments = {
@@ -283,7 +277,7 @@ def list_by_environment(
283277

284278
# Construct parameters
285279
query_parameters = {}
286-
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
280+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
287281

288282
# Construct headers
289283
header_parameters = {}
@@ -314,72 +308,3 @@ def list_by_environment(
314308

315309
return deserialized
316310
list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions'}
317-
318-
def list_by_os(
319-
self, location, os_type, custom_headers=None, raw=False, **operation_config):
320-
"""Gets the list of Service Fabric cluster code versions available for the
321-
specified OS type.
322-
323-
Gets all available code versions for Service Fabric cluster resources
324-
by OS type.
325-
326-
:param location: The location for the cluster code versions. This is
327-
different from cluster location.
328-
:type location: str
329-
:param os_type: The operating system of the cluster. Possible values
330-
include: 'Windows', 'Ubuntu', 'RedHat', 'Ubuntu18_04'
331-
:type os_type: str
332-
:param dict custom_headers: headers that will be added to the request
333-
:param bool raw: returns the direct response alongside the
334-
deserialized response
335-
:param operation_config: :ref:`Operation configuration
336-
overrides<msrest:optionsforoperations>`.
337-
:return: list or ClientRawResponse if raw=true
338-
:rtype:
339-
list[~azure.mgmt.servicefabric.models.ManagedClusterVersionDetails] or
340-
~msrest.pipeline.ClientRawResponse
341-
:raises:
342-
:class:`ErrorModelException<azure.mgmt.servicefabric.models.ErrorModelException>`
343-
"""
344-
api_version = "2020-01-01-preview"
345-
346-
# Construct URL
347-
url = self.list_by_os.metadata['url']
348-
path_format_arguments = {
349-
'location': self._serialize.url("location", location, 'str'),
350-
'osType': self._serialize.url("os_type", os_type, 'str'),
351-
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
352-
}
353-
url = self._client.format_url(url, **path_format_arguments)
354-
355-
# Construct parameters
356-
query_parameters = {}
357-
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
358-
359-
# Construct headers
360-
header_parameters = {}
361-
header_parameters['Accept'] = 'application/json'
362-
if self.config.generate_client_request_id:
363-
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
364-
if custom_headers:
365-
header_parameters.update(custom_headers)
366-
if self.config.accept_language is not None:
367-
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
368-
369-
# Construct and send request
370-
request = self._client.get(url, query_parameters, header_parameters)
371-
response = self._client.send(request, stream=False, **operation_config)
372-
373-
if response.status_code not in [200]:
374-
raise models.ErrorModelException(self._deserialize, response)
375-
376-
deserialized = None
377-
if response.status_code == 200:
378-
deserialized = self._deserialize('[ManagedClusterVersionDetails]', response)
379-
380-
if raw:
381-
client_raw_response = ClientRawResponse(deserialized, response)
382-
return client_raw_response
383-
384-
return deserialized
385-
list_by_os.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedclusters/locations/{location}/osType/{osType}/clusterVersions'}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
import uuid
13+
from msrest.pipeline import ClientRawResponse
14+
15+
from .. import models
16+
17+
18+
class ManagedClusterVersionsOperations(object):
19+
"""ManagedClusterVersionsOperations operations.
20+
21+
You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute.
22+
23+
:param client: Client for service requests.
24+
:param config: Configuration of service client.
25+
:param serializer: An object model serializer.
26+
:param deserializer: An object model deserializer.
27+
:ivar api_version: The version of the Service Fabric resource provider API. This is a required parameter and it's value must be "2020-01-01-preview" for this specification. Constant value: "2020-01-01-preview".
28+
"""
29+
30+
models = models
31+
32+
def __init__(self, client, config, serializer, deserializer):
33+
34+
self._client = client
35+
self._serialize = serializer
36+
self._deserialize = deserializer
37+
self.api_version = "2020-01-01-preview"
38+
39+
self.config = config
40+
41+
def list_by_os(
42+
self, location, os_type, custom_headers=None, raw=False, **operation_config):
43+
"""Gets the list of Service Fabric cluster code versions available for the
44+
specified OS type.
45+
46+
Gets all available code versions for Service Fabric cluster resources
47+
by OS type.
48+
49+
:param location: The location for the cluster code versions. This is
50+
different from cluster location.
51+
:type location: str
52+
:param os_type: The operating system of the cluster. Possible values
53+
include: 'Windows', 'Ubuntu', 'RedHat', 'Ubuntu18_04'
54+
:type os_type: str
55+
:param dict custom_headers: headers that will be added to the request
56+
:param bool raw: returns the direct response alongside the
57+
deserialized response
58+
:param operation_config: :ref:`Operation configuration
59+
overrides<msrest:optionsforoperations>`.
60+
:return: list or ClientRawResponse if raw=true
61+
:rtype:
62+
list[~azure.mgmt.servicefabric.models.ManagedClusterVersionDetails] or
63+
~msrest.pipeline.ClientRawResponse
64+
:raises:
65+
:class:`ErrorModelException<azure.mgmt.servicefabric.models.ErrorModelException>`
66+
"""
67+
# Construct URL
68+
url = self.list_by_os.metadata['url']
69+
path_format_arguments = {
70+
'location': self._serialize.url("location", location, 'str'),
71+
'osType': self._serialize.url("os_type", os_type, 'str'),
72+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
73+
}
74+
url = self._client.format_url(url, **path_format_arguments)
75+
76+
# Construct parameters
77+
query_parameters = {}
78+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
79+
80+
# Construct headers
81+
header_parameters = {}
82+
header_parameters['Accept'] = 'application/json'
83+
if self.config.generate_client_request_id:
84+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
85+
if custom_headers:
86+
header_parameters.update(custom_headers)
87+
if self.config.accept_language is not None:
88+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
89+
90+
# Construct and send request
91+
request = self._client.get(url, query_parameters, header_parameters)
92+
response = self._client.send(request, stream=False, **operation_config)
93+
94+
if response.status_code not in [200]:
95+
raise models.ErrorModelException(self._deserialize, response)
96+
97+
deserialized = None
98+
if response.status_code == 200:
99+
deserialized = self._deserialize('[ManagedClusterVersionDetails]', response)
100+
101+
if raw:
102+
client_raw_response = ClientRawResponse(deserialized, response)
103+
return client_raw_response
104+
105+
return deserialized
106+
list_by_os.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedclusters/locations/{location}/osType/{osType}/clusterVersions'}

0 commit comments

Comments
 (0)