0

I want to access an Azure VM Scale Set via the Python SDK, to get a list of all the NICs inside it. To do that, I'm guessing I need to use the link, but I don't know what each parameter should be for the NetworkInterfacesOperations class

NetworkInterfacesOperations(client, config, serializer, deserializer)

Varun Vembar
  • 318
  • 5
  • 18
  • Did see this? :https://learn.microsoft.com/en-us/python/api/azure.mgmt.network.v2017_09_01.operations.networkinterfacesoperations?view=azure-python#azure_mgmt_network_v2017_09_01_operations_NetworkInterfacesOperations_list_virtual_machine_scale_set_network_interfaces – Wayne Yang Dec 29 '17 at 09:10
  • so you are literally linking to the same page and asking if he saw it? – 4c74356b41 Dec 29 '17 at 09:26
  • I think that every parameter of that scripts has already been in the document. – Wayne Yang Dec 29 '17 at 09:39

1 Answers1

1

You don't create directly an instance of this class, this class will be an attribute on the Network client.

Example on how to create a Network client:

Some info about authentication:

Once you have a client, you can access VMSS NICs:

nics = client.network_interfaces.list_virtual_machine_scale_set_network_interfaces(
    resource_group_name,
    virtual_machine_scale_set_name
)

List operations returns an Iterator like subclass. In this case, content are NetworkInterface instance.

for nic in nics:
    do_something(nic)

All Iterators syntax are allowed (next(), list-comprehension, list(), etc.)

Laurent Mazuel
  • 3,422
  • 13
  • 27