You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Unable to get VNIC based on VNIC OCID using BMC API through Python

edited Jul 4, 2017 7:00AM in OCI - General 1 comment

Summary

Unable to get VNIC based on VNIC OCID using BMC API through Python

Content

Hi All,

I am trying to retrieve private IP of a VNIC using GetVNIC operation available under 'Core Services API'[https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Vnic/GetVnic ].

I am trying the following python code snippet -

response = compute_client.list_vnic_attachments(compartment_id, availability_domain=blocked_ip_query_object['domain']) //get list of Attachments first

for vnicatt in response.data:

vnic_response = virtual_network_client.get_vnic(vnicatt.vnic_id)//'ocid1.vnic.oc1.phx.abyhqljt2gsn4fti3lkjwymvrfb7umwpgdq22uzlkpatul4a5oxxcsltbucq' - sample

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!