Skip to content

pdube/go-cloudca

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-cloudca

Cloud.ca client for the Go programming language

Example

package main

import (
	"github.com/cloud-ca/go-cloudca"
	"github.com/cloud-ca/go-cloudca/services/cloudca"
	"fmt"
	)

func main() {
	//Create a CcaClient
	ccaClient := gocca.NewCcaClient("[your-api-key]")
	
	//Get the available resources for a specific service and environment
	ccaResources := ccaClient.GetResources("[service-code]", "[environment-name]").(cloudca.Resources)
	
	//Get the list of instances
	instances, _ := ccaResources.Instances.List()
	fmt.Println(instances)
	
	//Get a volume with its id
	volume, _ := ccaResources.Volumes.Get("[some-volume-id]")
	fmt.Println(volume)
	
	//Create an instance
	createdInstance, _ := ccaResources.Instances.Create(cloudca.Instance{
			Name: "[new-instance-name]",
			TemplateId: "[some-template-id]",
			ComputeOfferingId:"[some-compute-offering-id]",
			NetworkId:"[some-network-id]",
		})
	fmt.Println(createdInstance)
}

#License

This project is licensed under the terms of the MIT license.

About

Cloud.ca client for the Go programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%