1packagemain
+ 2
+ 3import(
+ 4"runtime"
+ 5
+ 6"go.anx.io/e5e"
+ 7)
+ 8
+ 9typeSumEventDatastruct{
+10Aint`json:"a"`
+11Bint`json:"b"`
+12}
+13
+14typeSumEventstruct{
+15e5e.Event
+16DataSumEventData`json:"data,omitempty"`
+17}
+18
+19// Using a custom `e5e.Context` class is optional and only needed to access the `Data` attribute on the
+20// context. This attribute may be used to get the return value of an authorizer function, for example. If access
+21// to the `Data` attribute is not needed, the `e5e.Context` type can be used on the entrypoint directly.
+22
+23typeSumContextDatastruct{
+24AuthKeystring`json:"auth_key"`
+25}
+26
+27typeSumContextstruct{
+28e5e.Context
+29DataSumContextData`json:"data,omitempty"`
+30}
+31
+32typeentrypointsstruct{}
+33
+34func(f*entrypoints)MyEntrypoint(eventSumEvent,contextSumContext)(e5e.Result,error){
+35returne5e.Result{
+36Status:200,
+37ResponseHeaders:map[string]string{
+38"x-custom-response-header":"This is a custom response header",
+39},
+40Data:map[string]interface{}{
+41"sum":event.Data.A+event.Data.B,
+42"version":runtime.Version(),
+43},
+44},nil
+45}
+46
+47funcmain(){
+48e5e.Start(&entrypoints{})
+49}
+
1packagemain
+ 2
+ 3import(
+ 4"runtime"
+ 5
+ 6"go.anx.io/e5e"
+ 7)
+ 8
+ 9typeSumEventDatastruct{
+10Aint`json:"a"`
+11Bint`json:"b"`
+12}
+13
+14typeSumEventstruct{
+15e5e.Event
+16DataSumEventData`json:"data,omitempty"`
+17}
+18
+19// Using a custom `e5e.Context` class is optional and only needed to access the `Data` attribute on the
+20// context. This attribute may be used to get the return value of an authorizer function, for example. If access
+21// to the `Data` attribute is not needed, the `e5e.Context` type can be used on the entrypoint directly.
+22
+23typeSumContextDatastruct{
+24AuthKeystring`json:"auth_key"`
+25}
+26
+27typeSumContextstruct{
+28e5e.Context
+29DataSumContextData`json:"data,omitempty"`
+30}
+31
+32typeentrypointsstruct{}
+33
+34func(f*entrypoints)MyEntrypoint(eventSumEvent,contextSumContext)(e5e.Result,error){
+35returne5e.Result{
+36Status:200,
+37ResponseHeaders:map[string]string{
+38"x-custom-response-header":"This is a custom response header",
+39},
+40Data:map[string]interface{}{
+41"sum":event.Data.A+event.Data.B,
+42"version":runtime.Version(),
+43},
+44},nil
+45}
+46
+47funcmain(){
+48e5e.Start(&entrypoints{})
+49}
+
1packagemain
+ 2
+ 3import(
+ 4"runtime"
+ 5
+ 6"go.anx.io/e5e"
+ 7)
+ 8
+ 9typeSumEventDatastruct{
+10Aint`json:"a"`
+11Bint`json:"b"`
+12}
+13
+14typeSumEventstruct{
+15e5e.Event
+16DataSumEventData`json:"data,omitempty"`
+17}
+18
+19// Using a custom `e5e.Context` class is optional and only needed to access the `Data` attribute on the
+20// context. This attribute may be used to get the return value of an authorizer function, for example. If access
+21// to the `Data` attribute is not needed, the `e5e.Context` type can be used on the entrypoint directly.
+22
+23typeSumContextDatastruct{
+24AuthKeystring`json:"auth_key"`
+25}
+26
+27typeSumContextstruct{
+28e5e.Context
+29DataSumContextData`json:"data,omitempty"`
+30}
+31
+32typeentrypointsstruct{}
+33
+34func(f*entrypoints)MyEntrypoint(eventSumEvent,contextSumContext)(e5e.Result,error){
+35returne5e.Result{
+36Status:200,
+37ResponseHeaders:map[string]string{
+38"x-custom-response-header":"This is a custom response header",
+39},
+40Data:map[string]interface{}{
+41"sum":event.Data.A+event.Data.B,
+42"version":runtime.Version(),
+43},
+44},nil
+45}
+46
+47funcmain(){
+48e5e.Start(&entrypoints{})
+49}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md/index.html b/go-anxcloud/README.md/index.html
new file mode 100644
index 0000000000..e58d10053c
--- /dev/null
+++ b/go-anxcloud/README.md/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@SYSENG-1670/make-vm-nics-updatable/index.html b/go-anxcloud/README.md@SYSENG-1670/make-vm-nics-updatable/index.html
new file mode 100644
index 0000000000..b0a9c441da
--- /dev/null
+++ b/go-anxcloud/README.md@SYSENG-1670/make-vm-nics-updatable/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@SYSENG-1741/index.html b/go-anxcloud/README.md@SYSENG-1741/index.html
new file mode 100644
index 0000000000..c80f7c13ac
--- /dev/null
+++ b/go-anxcloud/README.md@SYSENG-1741/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@SYSENG-1822-fix-ResourceWithTag/index.html b/go-anxcloud/README.md@SYSENG-1822-fix-ResourceWithTag/index.html
new file mode 100644
index 0000000000..fccf6469d3
--- /dev/null
+++ b/go-anxcloud/README.md@SYSENG-1822-fix-ResourceWithTag/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@SYSENG-679/virtualmachine/index.html b/go-anxcloud/README.md@SYSENG-679/virtualmachine/index.html
new file mode 100644
index 0000000000..4655b0b10c
--- /dev/null
+++ b/go-anxcloud/README.md@SYSENG-679/virtualmachine/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@decode-prefix-vlans/index.html b/go-anxcloud/README.md@decode-prefix-vlans/index.html
new file mode 100644
index 0000000000..b1c12610e3
--- /dev/null
+++ b/go-anxcloud/README.md@decode-prefix-vlans/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@dependabot/go_modules/github.com/onsi/ginkgo/v2-2.22.0/index.html b/go-anxcloud/README.md@dependabot/go_modules/github.com/onsi/ginkgo/v2-2.22.0/index.html
new file mode 100644
index 0000000000..4677de095d
--- /dev/null
+++ b/go-anxcloud/README.md@dependabot/go_modules/github.com/onsi/ginkgo/v2-2.22.0/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@lbaasv2-cs/index.html b/go-anxcloud/README.md@lbaasv2-cs/index.html
new file mode 100644
index 0000000000..471fa6958a
--- /dev/null
+++ b/go-anxcloud/README.md@lbaasv2-cs/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@main/index.html b/go-anxcloud/README.md@main/index.html
new file mode 100644
index 0000000000..f30a5a9581
--- /dev/null
+++ b/go-anxcloud/README.md@main/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@mgmt-bindings/index.html b/go-anxcloud/README.md@mgmt-bindings/index.html
new file mode 100644
index 0000000000..7e932ad9a7
--- /dev/null
+++ b/go-anxcloud/README.md@mgmt-bindings/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@syseng-728/cancel-object-channel/index.html b/go-anxcloud/README.md@syseng-728/cancel-object-channel/index.html
new file mode 100644
index 0000000000..19d046bbbf
--- /dev/null
+++ b/go-anxcloud/README.md@syseng-728/cancel-object-channel/index.html
@@ -0,0 +1,307 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@syseng-923/ipam-generic-client/index.html b/go-anxcloud/README.md@syseng-923/ipam-generic-client/index.html
new file mode 100644
index 0000000000..3c0dd92908
--- /dev/null
+++ b/go-anxcloud/README.md@syseng-923/ipam-generic-client/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.1.0/index.html b/go-anxcloud/README.md@v0.1.0/index.html
new file mode 100644
index 0000000000..dc107c7ee2
--- /dev/null
+++ b/go-anxcloud/README.md@v0.1.0/index.html
@@ -0,0 +1,242 @@
+
+
+
+ go.anx.io/go-anxcloud - anxcloud
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
anxcloud
+
go client for anexia engine
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.2.0/index.html b/go-anxcloud/README.md@v0.2.0/index.html
new file mode 100644
index 0000000000..eb323b65e8
--- /dev/null
+++ b/go-anxcloud/README.md@v0.2.0/index.html
@@ -0,0 +1,242 @@
+
+
+
+ go.anx.io/go-anxcloud - anxcloud
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
anxcloud
+
go client for anexia engine
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.0/index.html b/go-anxcloud/README.md@v0.3.0/index.html
new file mode 100644
index 0000000000..3a151f63bc
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.0/index.html
@@ -0,0 +1,242 @@
+
+
+
+ go.anx.io/go-anxcloud - anxcloud
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
anxcloud
+
go client for anexia engine
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.1/index.html b/go-anxcloud/README.md@v0.3.1/index.html
new file mode 100644
index 0000000000..60e880c684
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.1/index.html
@@ -0,0 +1,242 @@
+
+
+
+ go.anx.io/go-anxcloud - anxcloud
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
anxcloud
+
go client for anexia engine
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.10/index.html b/go-anxcloud/README.md@v0.3.10/index.html
new file mode 100644
index 0000000000..75293302ef
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.10/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.11/index.html b/go-anxcloud/README.md@v0.3.11/index.html
new file mode 100644
index 0000000000..099efb02da
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.11/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.12/index.html b/go-anxcloud/README.md@v0.3.12/index.html
new file mode 100644
index 0000000000..621484f871
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.12/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.13/index.html b/go-anxcloud/README.md@v0.3.13/index.html
new file mode 100644
index 0000000000..ac654c54b9
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.13/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.14/index.html b/go-anxcloud/README.md@v0.3.14/index.html
new file mode 100644
index 0000000000..c3cb517cd2
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.14/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.15/index.html b/go-anxcloud/README.md@v0.3.15/index.html
new file mode 100644
index 0000000000..a5592877b6
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.15/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.16/index.html b/go-anxcloud/README.md@v0.3.16/index.html
new file mode 100644
index 0000000000..c79a17654d
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.16/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.17/index.html b/go-anxcloud/README.md@v0.3.17/index.html
new file mode 100644
index 0000000000..6ecb78622a
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.17/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.18/index.html b/go-anxcloud/README.md@v0.3.18/index.html
new file mode 100644
index 0000000000..84e579cce7
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.18/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.19/index.html b/go-anxcloud/README.md@v0.3.19/index.html
new file mode 100644
index 0000000000..c3a69d0f91
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.19/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.2/index.html b/go-anxcloud/README.md@v0.3.2/index.html
new file mode 100644
index 0000000000..81b56c88da
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.2/index.html
@@ -0,0 +1,242 @@
+
+
+
+ go.anx.io/go-anxcloud - anxcloud
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
anxcloud
+
go client for anexia engine
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.20/index.html b/go-anxcloud/README.md@v0.3.20/index.html
new file mode 100644
index 0000000000..1fc68fdd30
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.20/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.21/index.html b/go-anxcloud/README.md@v0.3.21/index.html
new file mode 100644
index 0000000000..59f34851da
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.21/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.22/index.html b/go-anxcloud/README.md@v0.3.22/index.html
new file mode 100644
index 0000000000..e6155fce35
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.22/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.23/index.html b/go-anxcloud/README.md@v0.3.23/index.html
new file mode 100644
index 0000000000..bb44754d37
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.23/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.24/index.html b/go-anxcloud/README.md@v0.3.24/index.html
new file mode 100644
index 0000000000..cd8bfe7213
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.24/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.25/index.html b/go-anxcloud/README.md@v0.3.25/index.html
new file mode 100644
index 0000000000..2e61eaac9b
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.25/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.26/index.html b/go-anxcloud/README.md@v0.3.26/index.html
new file mode 100644
index 0000000000..fe9f2c0ebf
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.26/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.27/index.html b/go-anxcloud/README.md@v0.3.27/index.html
new file mode 100644
index 0000000000..6b8fb4fdb6
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.27/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.28/index.html b/go-anxcloud/README.md@v0.3.28/index.html
new file mode 100644
index 0000000000..615b29f4b9
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.28/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.3/index.html b/go-anxcloud/README.md@v0.3.3/index.html
new file mode 100644
index 0000000000..fec5498921
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.3/index.html
@@ -0,0 +1,242 @@
+
+
+
+ go.anx.io/go-anxcloud - anxcloud
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
anxcloud
+
go client for anexia engine
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.4/index.html b/go-anxcloud/README.md@v0.3.4/index.html
new file mode 100644
index 0000000000..0b15ee3520
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.4/index.html
@@ -0,0 +1,242 @@
+
+
+
+ go.anx.io/go-anxcloud - anxcloud
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
anxcloud
+
go client for anexia engine
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.5/index.html b/go-anxcloud/README.md@v0.3.5/index.html
new file mode 100644
index 0000000000..661b95fe0c
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.5/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.6/index.html b/go-anxcloud/README.md@v0.3.6/index.html
new file mode 100644
index 0000000000..d796530755
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.6/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.7/index.html b/go-anxcloud/README.md@v0.3.7/index.html
new file mode 100644
index 0000000000..031e5aca8d
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.7/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.8/index.html b/go-anxcloud/README.md@v0.3.8/index.html
new file mode 100644
index 0000000000..1b0b969471
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.8/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.3.9/index.html b/go-anxcloud/README.md@v0.3.9/index.html
new file mode 100644
index 0000000000..3c26ded488
--- /dev/null
+++ b/go-anxcloud/README.md@v0.3.9/index.html
@@ -0,0 +1,306 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia multi purpose API.
+
Installing
+
To use the SDK, just add github.com/anexia-it/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the API. See here for more info.
+I you crave for an example, take a look at the terraform provider for this project
+
Example
+
The following code shows how to create a VM. To be able to do that you need to set the environment variable ANEXIA_TOKEN to your access token.
+Afterwards you can run the following.
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"github.com/anexia-it/go-anxcloud/pkg"
+ 9"github.com/anexia-it/go-anxcloud/pkg/client"
+10"github.com/anexia-it/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client from environment variables, do not unset env afterwards.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.4.0/index.html b/go-anxcloud/README.md@v0.4.0/index.html
new file mode 100644
index 0000000000..c97a1c43fc
--- /dev/null
+++ b/go-anxcloud/README.md@v0.4.0/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.4.1/index.html b/go-anxcloud/README.md@v0.4.1/index.html
new file mode 100644
index 0000000000..cbc70d7374
--- /dev/null
+++ b/go-anxcloud/README.md@v0.4.1/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.4.2/index.html b/go-anxcloud/README.md@v0.4.2/index.html
new file mode 100644
index 0000000000..c8f8b19df1
--- /dev/null
+++ b/go-anxcloud/README.md@v0.4.2/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.4.3/index.html b/go-anxcloud/README.md@v0.4.3/index.html
new file mode 100644
index 0000000000..f9498bbf90
--- /dev/null
+++ b/go-anxcloud/README.md@v0.4.3/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.4.4/index.html b/go-anxcloud/README.md@v0.4.4/index.html
new file mode 100644
index 0000000000..d75cf0edce
--- /dev/null
+++ b/go-anxcloud/README.md@v0.4.4/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.4.5/index.html b/go-anxcloud/README.md@v0.4.5/index.html
new file mode 100644
index 0000000000..2ccf8656e7
--- /dev/null
+++ b/go-anxcloud/README.md@v0.4.5/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.4.6/index.html b/go-anxcloud/README.md@v0.4.6/index.html
new file mode 100644
index 0000000000..3597f449db
--- /dev/null
+++ b/go-anxcloud/README.md@v0.4.6/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.5.0/index.html b/go-anxcloud/README.md@v0.5.0/index.html
new file mode 100644
index 0000000000..ee495846ff
--- /dev/null
+++ b/go-anxcloud/README.md@v0.5.0/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.5.1/index.html b/go-anxcloud/README.md@v0.5.1/index.html
new file mode 100644
index 0000000000..8445dccba9
--- /dev/null
+++ b/go-anxcloud/README.md@v0.5.1/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.5.2/index.html b/go-anxcloud/README.md@v0.5.2/index.html
new file mode 100644
index 0000000000..e12107ac37
--- /dev/null
+++ b/go-anxcloud/README.md@v0.5.2/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.5.3/index.html b/go-anxcloud/README.md@v0.5.3/index.html
new file mode 100644
index 0000000000..a4f1058bc7
--- /dev/null
+++ b/go-anxcloud/README.md@v0.5.3/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.6.0/index.html b/go-anxcloud/README.md@v0.6.0/index.html
new file mode 100644
index 0000000000..297e4e723c
--- /dev/null
+++ b/go-anxcloud/README.md@v0.6.0/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.6.1/index.html b/go-anxcloud/README.md@v0.6.1/index.html
new file mode 100644
index 0000000000..c6a131ae7f
--- /dev/null
+++ b/go-anxcloud/README.md@v0.6.1/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.6.2/index.html b/go-anxcloud/README.md@v0.6.2/index.html
new file mode 100644
index 0000000000..ff7ae34adc
--- /dev/null
+++ b/go-anxcloud/README.md@v0.6.2/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.6.3/index.html b/go-anxcloud/README.md@v0.6.3/index.html
new file mode 100644
index 0000000000..992c6acf1b
--- /dev/null
+++ b/go-anxcloud/README.md@v0.6.3/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.6.4/index.html b/go-anxcloud/README.md@v0.6.4/index.html
new file mode 100644
index 0000000000..4fcb797457
--- /dev/null
+++ b/go-anxcloud/README.md@v0.6.4/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.7.0/index.html b/go-anxcloud/README.md@v0.7.0/index.html
new file mode 100644
index 0000000000..c1e685c6ec
--- /dev/null
+++ b/go-anxcloud/README.md@v0.7.0/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.7.1/index.html b/go-anxcloud/README.md@v0.7.1/index.html
new file mode 100644
index 0000000000..5d569faaf2
--- /dev/null
+++ b/go-anxcloud/README.md@v0.7.1/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.7.2/index.html b/go-anxcloud/README.md@v0.7.2/index.html
new file mode 100644
index 0000000000..975acbb224
--- /dev/null
+++ b/go-anxcloud/README.md@v0.7.2/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.7.3/index.html b/go-anxcloud/README.md@v0.7.3/index.html
new file mode 100644
index 0000000000..b711db287a
--- /dev/null
+++ b/go-anxcloud/README.md@v0.7.3/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.7.4/index.html b/go-anxcloud/README.md@v0.7.4/index.html
new file mode 100644
index 0000000000..18aba73689
--- /dev/null
+++ b/go-anxcloud/README.md@v0.7.4/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.7.5/index.html b/go-anxcloud/README.md@v0.7.5/index.html
new file mode 100644
index 0000000000..0032fc7c51
--- /dev/null
+++ b/go-anxcloud/README.md@v0.7.5/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/README.md@v0.7.6/index.html b/go-anxcloud/README.md@v0.7.6/index.html
new file mode 100644
index 0000000000..e58d10053c
--- /dev/null
+++ b/go-anxcloud/README.md@v0.7.6/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-anxcloud/index.html b/go-anxcloud/index.html
new file mode 100644
index 0000000000..e58d10053c
--- /dev/null
+++ b/go-anxcloud/index.html
@@ -0,0 +1,367 @@
+
+
+
+ go.anx.io/go-anxcloud - Go Client for the Anexia API
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-anxcloud
+
+
+
+
+
+
+
Go Client for the Anexia API
+
Go SDK for interacting with the Anexia Engine API.
+
Installing
+
To use the SDK, just add go.anx.io/go-anxcloud <version> to your Go module.
+
Getting started
+
Before using the SDK you should familiarize yourself with the Anexia Engine API.
+
The library is used in our terraform provider, check it out if you want some examples how to use it.
+
Example
+
Below is a short example using the new generic client in this package. Not all APIs can already be used with it, but we are working on that.
+Find more examples in the docs (linked to docs for
+main branch, not the latest (or any) release).
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"log"
+ 6
+ 7"go.anx.io/go-anxcloud/pkg/api"
+ 8apiTypes"go.anx.io/go-anxcloud/pkg/api/types"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10
+11// apis usable with the generic client have their own package in a location analog to this
+12lbaasv1"go.anx.io/go-anxcloud/pkg/apis/lbaas/v1"
+13)
+14
+15funcmain(){
+16apiClient,err:=api.NewAPI(
+17api.WithClientOptions(
+18// Get auth token from ANEXIA_TOKEN environment variable.
+19// The boolean parameter specifies if the environment variable should be unset.
+20client.TokenFromEnv(false),
+21),
+22)
+23iferr!=nil{
+24log.Fatalf("Error creating ANX API client: %v",err)
+25}
+26
+27// let's list LBaaS backends of a known LoadBalancer
+28frontend:=lbaasv1.Frontend{
+29LoadBalancer:&lbaasv1.LoadBalancer{Identifier:"285b954fdf2a449c8fdae01cc6074025"},
+30}
+31
+32varfrontendsapiTypes.ObjectChannel
+33err=apiClient.List(context.TODO(),&frontend,
+34// Listing can be done with either a page iterator or a channel, we use a channel here.
+35api.ObjectChannel(&frontends),
+36
+37// Most APIs only give a very small subset when listing resources, add this flag to
+38// get all attributes, at the cost of doing lots of API requests.
+39api.FullObjects(true),
+40)
+41iferr!=nil{
+42log.Fatalf("Error listing backends for LoadBalancer '%v': %v",frontend.LoadBalancer.Identifier,err)
+43}
+44
+45forretriever:=rangefrontends{
+46// reinitialise frontend every loop to reset pointers and avoid potential overwriting of data in the next loop
+47varfrontendlbaasv1.Frontend
+48iferr:=retriever(&frontend);err!=nil{
+49log.Fatalf("Error retrieving Frontend: %v",err)
+50}
+51
+52log.Printf("Got Frontend named '%v' with mode '%v'",frontend.Name,frontend.Mode)
+53}
+54}
+
This new generic client will one day be the only client in go-anxcloud. The legacy API-specific clients are deprecated and will be removed in the
+go-anxcloud release following the one with all APIs go-anxcloud supports usable with the generic client (so if the generic client in 0.5.0 supports
+at least everything there is another client for in go-anxcloud, 0.6.0 will drop the API-specific clients).
+
+
1packagemain
+ 2
+ 3import(
+ 4"context"
+ 5"fmt"
+ 6"time"
+ 7
+ 8anexia"go.anx.io/go-anxcloud/pkg"
+ 9"go.anx.io/go-anxcloud/pkg/client"
+10"go.anx.io/go-anxcloud/pkg/vsphere/provisioning/vm"
+11)
+12
+13funcmain(){
+14vlan:="<ID of the VLAN the VM should have access to>"
+15location:="<ID of the location the VM should be in>"
+16
+17// Create client using the auth token in environment variable ANEXIA_TOKEN and do not unset the environment variable.
+18c,err:=client.New(client.AuthFromEnv(false))
+19iferr!=nil{
+20panic(fmt.Sprintf("could not create client: %v",err))
+21}
+22
+23// Get some API.
+24provisioning:=anexia.NewAPI(c).VSphere().Provisioning()
+25
+26// Time out after 30 minutes. Yes it really takes that long sometimes.
+27ctx,cancel:=context.WithTimeout(context.Background(),30*time.Minute)
+28// Look for a free ip in the given VLAN. This IP is not reserved for you so better be quick.
+29ips,err:=provisioning.IPs().GetFree(ctx,location,vlan)
+30defercancel()
+31iferr!=nil{
+32panic(fmt.Sprintf("provisioning vm failed: %v",err))
+33}
+34iflen(ips)<1{
+35panic(fmt.Sprintf("no IPs left for testing in vlan"))
+36}
+37
+38// Create a NIC for the VM and connect it to the VLAN.
+39networkInterfaces:=[]vm.Network{{NICType:"vmxnet3",IPs:[]string{ips[0].Identifier},VLAN:vlan}}
+40// Create the definition of the new VM. The ID you see here is Flatcar.
+41definition:=vm.NewAPI(c).NewDefinition(location,"template","44b38284-6adb-430e-b4a4-1553e29f352f","developersfirstvm",2,2048,10,networkInterfaces)
+42definition.SSH="<your SSH pub key>"
+43
+44// Provision the VM.
+45provisionResponse,err:=provisioning.VM().Provision(ctx,definition)
+46iferr!=nil{
+47panic(fmt.Sprintf("provisioning vm failed: %v",err))
+48}
+49
+50// Wait for the VM to be ready.
+51_,err=provisioning.Progress().AwaitCompletion(ctx,provisionResponse.Identifier)
+52iferr!=nil{
+53panic(fmt.Sprintf("waiting for VM provisioning failed: %v",err))
+54}
+55}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/go-cloudlog/README.md/index.html b/go-cloudlog/README.md/index.html
new file mode 100644
index 0000000000..fde0941f7f
--- /dev/null
+++ b/go-cloudlog/README.md/index.html
@@ -0,0 +1,111 @@
+
+
+
+ go.anx.io/go-cloudlog - go-cloudlog
+
+
+
+
+
+
+
+
+
+
+
go.anx.io/go-cloudlog
+
+
+
+ The highest tagged major version is v2.
+
+
+
+
go-cloudlog
+
+
+
+
+
go-cloudlog is a client library for Anexia CloudLog.
+
Currently it only provides to push events to CloudLog.
+
+
+
+
\ No newline at end of file
diff --git a/index.html b/index.html
new file mode 100644
index 0000000000..17f0332668
--- /dev/null
+++ b/index.html
@@ -0,0 +1,65 @@
+
+
+
+
+ go.anx.io - go packages by Anexia
+
+
+
+
+
+
+
+
+
+
+ go.anx.io - go packages by Anexia
+
+
+
+
Hello world!
+
This website lists a collection of our Go packages, making them available via our vanity URL.
+
There might be more packages not added to this website, looking at our GitHub
+is a good way to find all of them (the link filters for things written in Go).