Skip to content
Merged
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 @@ -566,6 +566,12 @@
- name: Update placement properties of the node type. This will overwrite older placement properties if any.
text: >
az sf managed-node-type update -g testRG -c testCluster -n snt --placement-property NodeColor=Red SomeProperty=6
- name: Update vm size of the node type. This will initiate an in-place swap of the vm size.
text: >
az sf managed-node-type update -g testRG -c testCluster -n snt --vm-size Standard_DS2_v2
- name: Update the node type tags.
text: >
az sf managed-node-type update -g testRG -c testCluster -n snt --tags key1=value1 key2=value2
"""

helps['sf managed-node-type delete'] = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ def load_arguments(self, _): # pylint: disable=too-many-statements

with self.argument_context('sf managed-node-type') as c:
c.argument('node_type_name', options_list=['-n', '--name', '--node-type-name'], help='node type name.')
c.argument('instance_count', help='essage = "The number of nodes in the node type.')

with self.argument_context('sf managed-node-type create') as c:
c.argument('instance_count', help='"The number of nodes in the node type.')
Comment thread
iliu816 marked this conversation as resolved.
c.argument('primary', arg_type=get_three_state_flag(), help='Specify if the node type is primary. On this node type will run system services. Only one node type should be marked as primary. Primary node type cannot be deleted or changed for existing clusters.')
c.argument('disk_size', type=int, options_list=['--disk-size', '--data-disk-size'], help='Disk size for each vm in the node type in GBs.', default=100)
c.argument('disk_type', arg_type=get_enum_type(DiskType), options_list=['--disk-type', '--data-disk-type'],
Expand All @@ -334,6 +336,18 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
c.argument('is_stateless', arg_type=get_three_state_flag(), help='Indicates if the node type can only host Stateless workloads.', default=False)
c.argument('multiple_placement_groups', options_list=['--multiple-placement-groups', '--multi-place-groups'], arg_type=get_three_state_flag(),
help='Indicates if scale set associated with the node type can be composed of multiple placement groups.', default=False)
c.argument('tags', arg_type=tags_type)

with self.argument_context('sf managed-node-type update') as c:
c.argument('instance_count', help='"The number of nodes in the node type.')
Comment thread
iliu816 marked this conversation as resolved.
c.argument('application_start_port', options_list=['--application-start-port', '--app-start-port'], help='Application start port of a range of ports.')
Comment thread
iliu816 marked this conversation as resolved.
c.argument('application_end_port', options_list=['--application-end-port', '--app-end-port'], help='Application End port of a range of ports.')
Comment thread
iliu816 marked this conversation as resolved.
c.argument('ephemeral_start_port', help='Ephemeral start port of a range of ports.')
Comment thread
iliu816 marked this conversation as resolved.
c.argument('ephemeral_end_port', help='Ephemeral end port of a range of ports.')
Comment thread
iliu816 marked this conversation as resolved.
c.argument('vm_size', help='The size of virtual machines in the pool. All virtual machines in a pool are the same size.')
Comment thread
iliu816 marked this conversation as resolved.
c.argument('capacity', arg_type=capacity)
c.argument('placement_property', arg_type=placement_property)
c.argument('tags', arg_type=tags_type)

with self.argument_context('sf managed-node-type node') as c:
c.argument('node_name', nargs='+', help='list of target nodes to perform the operation.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def create_node_type(cmd,
capacity=None,
placement_property=None,
is_stateless=False,
multiple_placement_groups=False):
multiple_placement_groups=False,
tags=None):

# set defult parameters
if disk_size is None:
Expand Down Expand Up @@ -78,7 +79,8 @@ def create_node_type(cmd,
capacities=capacity,
placement_properties=placement_property,
is_stateless=is_stateless,
multiple_placement_groups=multiple_placement_groups)
multiple_placement_groups=multiple_placement_groups,
tags=tags)

if application_start_port and application_end_port:
new_node_type.application_ports = EndpointRangeDescription(start_port=application_start_port,
Expand All @@ -103,12 +105,14 @@ def update_node_type(cmd,
cluster_name,
node_type_name,
instance_count=None,
vm_size=None,
application_start_port=None,
application_end_port=None,
ephemeral_start_port=None,
ephemeral_end_port=None,
capacity=None,
placement_property=None):
placement_property=None,
tags=None):
try:
node_type = client.node_types.get(resource_group_name, cluster_name, node_type_name)

Expand All @@ -129,6 +133,12 @@ def update_node_type(cmd,
if placement_property is not None:
node_type.placement_properties = placement_property

if vm_size is not None:
node_type.vm_size = vm_size

if tags is not None:
node_type.tags = tags

poller = client.node_types.begin_create_or_update(resource_group_name, cluster_name, node_type_name, node_type)
return LongRunningOperation(cmd.cli_ctx)(poller)
except HttpResponseError as ex:
Expand Down
Loading
Loading