On Oracle cloud infrastructure, I am trying to get the details of the VNICs attached to a compute instance. I can see there is an option available in oci-cli to pass the OCID of a compute instance and it provides the details of VNICs attached to the instance (works well !!).
oci compute instance list-vnics --instance-id <OCID of compute instance>
Reference: https://docs.cloud.oracle.com/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/compute/instance/list-vnics.html
However, there is no option available to get the same when REST API are used:
https://docs.cloud.oracle.com/iaas/api/#/en/iaas/20160918/Instance/
Please suggest the equivalent Rest API to retrieve the same result ?
The ultimate goal is to get the public IP of a OCI compute instance using RestAPI.
You'll want to use the ListVnicAttachments API, filtering on a specific instanceId, and then for each VnicAttachment response object call the GetVnic API, passing in the vnicId of the VnicAttachment.
Related
I have a general query regarding creating a simple REST API using Google Cloud Functions in Python. Is it best practice to create a HTTP function for each endpoint or create one function which handles all the endpoints?
Also is it possible to use a custom URL for the function e.g. /api/v1/pets/
I wrote 2 articles on that topic, one in Python and the other in Golang.
But I can't recommend you to do that for real world workload, it's fun when you hack but not more. You can have a look to my first article that explain why I prefer Cloud Run to Cloud Function, and the local testing is the main argument that I can offer. Then portability.
Google Cloud only supports one event definition per
function. However, you could handle multiple definition by using same sources or use one trigger which has a response to call another function that combines different kind of events. You can refer to this GCP docs.
If you want to use a custom URL, you can check out Cloud Endpoints since it acts as an API Gateway for Cloud Functions.
Is there a rest endpoint to retrieve keyrings at a project level directly in KMS rest appi.
As of now, current API needs keyrings on a per-location basis, I would like to get all keyRings on a specified project id, is there an endpoint. on Google CLoud UI you select a project and it simply lists all keyrings, is there an equivalent at Rest
There are REST and gRPC APIs for listing Key Rings.
GET https://cloudkms.googleapis.com/v1/projects/my-project/locations/loc/keyRings
If you want to find all keyrings in all locations, you need to list the available locations and enumerate the keyrings in each known location. KMS is fully regionalized for reliability reasons, so the service doesn't have APIs which interact with multiple regions.
I am trying to get the OS Image Name of a Google Cloud Instance Using REST API provided by Google. Tried lot of API's in Google API Explorer and have no idea how to get the OS Type. My Case is to populate "Windows" if the OS Type of Instance is Windows and so on.
The OS information is listed under "Source image" on the details of your boot disk.
Using the instance-get method of the API and searching for the "disk" parameters you can retrieve this information.
Is there any way to test Google Compute Engine API calls within a sandboxed environment for development/testing purposes? For example, to invoke an API call to create instances without having to create (and then pay for) actual instances.
Thanks
Also is there any api in v2 (c#) by which we can get all the users in a given group?
As of now i could not find any api exposed in the following sdk box csharp sdk. Please correct me if i am wrong
The Groups API isn't yet exposed in V2 but is being worked on.
You can get all the groups for a user by calling GET .../groups
You can get all the users in a given group by calling GET .../groups/id/memberships