Today, we are happy to announce the Go SDK for Oracle Cloud Infrastructure is now available! The Go SDK supports all Oracle Cloud Infrastructure services and will continue to support the same set of features as the Java, Python and Ruby SDKs. Similar to our open source developer tools and SDKs, the Go SDK is available at GitHub oci-go-sdk repo.
The Go programming language attracts developers with its ease of use and simplicity. It is particularly popular when it comes to cloud development, including the use of Kubernetes and Terraform. To provide developers with similar experiences, we are launching the Go SDK for Oracle Cloud Infrastructure. The Oracle Cloud Infrastructure Terraform Provider also uses the latest Go SDK, you can refer to details about Terraform Provider here.
Along with launching the first version of the Go SDK for Oracle Cloud Infrastructure, we are looking for your feedback on future improvements. We’d love to hear from you on the GitHub issues page.
Here is how you can get started:
- Install the Go SDK
go get -u github.com/oracle/oci-go-sdk - Configure the SDK with your Oracle Cloud Infrastructure credentials
- Start making API calls, such as this example:
package example import ( "context" "fmt" "log" "github.com/oracle/oci-go-sdk/common" "github.com/oracle/oci-go-sdk/example/helpers" "github.com/oracle/oci-go-sdk/identity" ) // ExampleListAvailabilityDomains Lists the Availability Domains in your tenancy. // Specify the OCID of either the tenancy or another of your compartments as // the value for the compartment ID (remember that the tenancy is simply the root compartment). func ExampleListAvailabilityDomains() { c, err := identity.NewIdentityClientWithConfigurationProvider(common.DefaultConfigProvider()) helpers.LogIfError(err) // The OCID of the tenancy containing the compartment. tenancyID, err := common.DefaultConfigProvider().TenancyOCID() helpers.LogIfError(err) request := identity.ListAvailabilityDomainsRequest{ CompartmentId: &tenancyID, } r, err := c.ListAvailabilityDomains(context.Background(), request) helpers.LogIfError(err) log.Printf("list of available domains: %v", r.Items) fmt.Println("list available domains completed") // Output: // list available domains completed }
To learn more, you can also refer to:
- Oracle Cloud Infrastructure Go SDK documentation
- Full documentation on the godocs site
- Code samples to get started
- Getting started with Oracle Cloud Infrastructure
If you need help, you can utilize these channels:
- Stack Overflow, use the oracle-cloud-infrastructure and oci-go-sdk tags in your post
- Developer Tools of the Oracle Cloud forums
- My Oracle Support