Skip to content

[Network] az network lb address-pool: support create lb backend pool with backend address.#13700

Merged
mmyyrroonn merged 13 commits intoAzure:devfrom
mmyyrroonn:fix-12937-support-lb-backend-pool
Jun 16, 2020
Merged

[Network] az network lb address-pool: support create lb backend pool with backend address.#13700
mmyyrroonn merged 13 commits intoAzure:devfrom
mmyyrroonn:fix-12937-support-lb-backend-pool

Conversation

@mmyyrroonn
Copy link
Copy Markdown
Contributor

Description

fix #12937
Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


This checklist is used to make sure that common guidelines for a pull request are followed.

@mmyyrroonn mmyyrroonn requested a review from haroldrandom as a code owner May 27, 2020 08:21
@mmyyrroonn mmyyrroonn requested a review from jsntcy May 27, 2020 08:21
@yonzhan yonzhan added this to the S170 milestone May 27, 2020
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 27, 2020

add to S170

@yonzhan yonzhan modified the milestones: S170, S171 May 31, 2020
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 31, 2020

add to S171

@mmyyrroonn mmyyrroonn force-pushed the fix-12937-support-lb-backend-pool branch from b01de9a to 14f1bc6 Compare June 2, 2020 07:59
del namespace.connection_id


def process_vnet_name_or_id(cmd, namespace):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated work?

def get_vnet_validator(dest):
from msrestazure.tools import is_valid_resource_id, resource_id
def _validate_vnet_name_or_id(cmd, namespace):
SubResource = cmd.get_models('SubResource')
subscription_id = get_subscription_id(cmd.cli_ctx)
resource_group = namespace.resource_group_name
names_or_ids = getattr(namespace, dest)
ids = []
if names_or_ids == [''] or not names_or_ids:
return
for val in names_or_ids:
if not is_valid_resource_id(val):
val = resource_id(
subscription=subscription_id,
resource_group=resource_group,
namespace='Microsoft.Network', type='virtualNetworks',
name=val
)
ids.append(SubResource(id=val))
setattr(namespace, dest, ids)
return _validate_vnet_name_or_id

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot use it since it's a list and SubResource. ids.append(SubResource(id=val))

ip_address=addr['ip_address']) for addr in addresses_pool] if addresses_pool else None
new_pool = BackendAddressPool(name=backend_address_pool_name,
load_balancer_backend_addresses=new_addresses)
return ncf.load_balancer_backend_address_pools.create_or_update(resource_group_name,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support no wait for LRO?

Copy link
Copy Markdown
Contributor Author

@mmyyrroonn mmyyrroonn Jun 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer keeping it as a sync command since we already supported it for a long time and the speed is quick enough. #Closed

address_pool = client.get(resource_group_name, load_balancer_name, backend_address_pool_name)
lb_addresses = [addr for addr in address_pool.load_balancer_backend_addresses if addr.name != address_name]
address_pool.load_balancer_backend_addresses = lb_addresses
return client.create_or_update(resource_group_name, load_balancer_name, backend_address_pool_name, address_pool)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support no wait?

Copy link
Copy Markdown
Contributor Author

@mmyyrroonn mmyyrroonn Jun 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer keeping it as a sync command. #Closed

raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussion: can we share generic logic for key-value arguments (keep naming the same as SDK parameters)

Copy link
Copy Markdown
Member

@jsntcy jsntcy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@mmyyrroonn mmyyrroonn merged commit e14ec3d into Azure:dev Jun 16, 2020
@mmyyrroonn mmyyrroonn deleted the fix-12937-support-lb-backend-pool branch June 16, 2020 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Service Team Request] CLI support needed for New LB backend format

4 participants