Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions examples/auditlog/auditlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ import (
)

func main() {
// Specify the project ID, startTime and endTime
projectId := "PROJECT_ID"
startTime := time.Now().Add(-time.Hour * 24)
endTime := time.Now()
limit := float32(100) // set pagination limit to avoid rate limit
projectId := "PROJECT_ID" // the uuid of your STACKIT project
startTime := time.Now().Add(-time.Hour * 24) // your start time
endTime := time.Now() // your end time
limit := float32(100) // set pagination limit to avoid rate limit

// Create a new API client, that uses default authentication and configuration
auditlogClient, err := auditlog.NewAPIClient()
Expand Down
4 changes: 3 additions & 1 deletion examples/authentication/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
)

func main() {
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// When creating a new API client without providing any configuration, it will setup default authentication.
// The SDK will search for a valid service account key or token in several locations.
// It will first try to use the key flow, by looking into the variables STACKIT_SERVICE_ACCOUNT_KEY, STACKIT_SERVICE_ACCOUNT_KEY_PATH,
Expand Down Expand Up @@ -53,7 +55,7 @@ func main() {
}

// Check that you can make an authenticated request
getZoneResp, err := dnsClient.ListZones(context.Background(), "PROJECT_ID").Execute()
getZoneResp, err := dnsClient.ListZones(context.Background(), projectId).Execute()

if err != nil {
fmt.Fprintf(os.Stderr, "[DNS API] Error when calling `ZoneApi.GetZones`: %v\n", err)
Expand Down
3 changes: 1 addition & 2 deletions examples/authorization/authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
yourEmail := "[email protected]"
emailToBeAdded := "[email protected]"

Expand Down
3 changes: 1 addition & 2 deletions examples/backgroundrefresh/backgroundrefresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a cancellable context
ctx := context.Background()
Expand Down
3 changes: 1 addition & 2 deletions examples/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a new API client, that uses default authentication and configuration
dnsClient, err := dns.NewAPIClient()
Expand Down
2 changes: 1 addition & 1 deletion examples/iaas/attach_nic/attach_nic.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func main() {
// Specify the organization ID and project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
serverId := "SERVER_ID"
nicId := "NIC_ID"

Expand Down
2 changes: 1 addition & 1 deletion examples/iaas/attach_public_ip/attach_public_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func main() {
// Specify the organization ID and project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
serverId := "SERVER_ID"
publicIpId := "PUBLIC_IP_ID"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func main() {
// Specify the organization ID and project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
serverId := "SERVER_ID"
securityGroupId := "SECURITY_GROUP_ID"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func main() {
// Specify the organization ID and project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
serverId := "SERVER_ID"
serviceAccountMail := "SERVICE_ACCOUNT_MAIL"

Expand Down
2 changes: 1 addition & 1 deletion examples/iaas/attach_volume/attach_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func main() {
// Specify the organization ID and project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
serverId := "SERVER_ID"
volumeId := "VOLUME_ID"

Expand Down
2 changes: 1 addition & 1 deletion examples/iaas/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func main() {
// Specify the organization ID and project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a new API client, that uses default authentication and configuration
iaasClient, err := iaas.NewAPIClient(
Expand Down
2 changes: 1 addition & 1 deletion examples/iaas/publicip/publicIp.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func main() {
// Specify the organization ID and project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a new API client, that uses default authentication and configuration
iaasClient, err := iaas.NewAPIClient(
Expand Down
2 changes: 1 addition & 1 deletion examples/iaas/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func main() {
// Specify the organization ID and project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a new API client, that uses default authentication and configuration
iaasClient, err := iaas.NewAPIClient(
Expand Down
2 changes: 1 addition & 1 deletion examples/iaas/volume/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func main() {
// Specify the organization ID and project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a new API client, that uses default authentication and configuration
iaasClient, err := iaas.NewAPIClient(
Expand Down
3 changes: 1 addition & 2 deletions examples/kms/kms.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
region := "eu01"

// Create a new API client, that uses default authentication and configuration
Expand Down
5 changes: 2 additions & 3 deletions examples/loadbalancer/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Specify the region
region := "REGION"
region := "eu01"

// Create a new API client, that uses default authentication and configuration
loadbalancerClient, err := loadbalancer.NewAPIClient()
Expand Down
3 changes: 1 addition & 2 deletions examples/logme/logme.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
planId := "PLAN_ID"

// Create a new API client, that uses default authentication and configuration
Expand Down
3 changes: 1 addition & 2 deletions examples/mariadb/mariadb.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
planId := "PLAN_ID"

// Create a new API client, that uses default authentication and configuration
Expand Down
3 changes: 1 addition & 2 deletions examples/middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func (rt roundTripperWithCapture) RoundTrip(req *http.Request) (*http.Response,
}

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a new API client, that uses default authentication
// Use the `WithMiddleware` option to add the middleware to the client
Expand Down
5 changes: 2 additions & 3 deletions examples/mongodbflex/mongodbflex.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Specify the region
region := "REGION"
region := "eu01"

// Create a new API client, that uses default authentication and configuration
mongodbflexClient, err := mongodbflex.NewAPIClient()
Expand Down
3 changes: 1 addition & 2 deletions examples/objectstorage/objectstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
region := "eu01"

// Create a new API client, that uses default authentication and configuration
Expand Down
3 changes: 1 addition & 2 deletions examples/observability/observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a new API client, that uses default authentication and configuration
observabilityClient, err := observability.NewAPIClient(
Expand Down
3 changes: 1 addition & 2 deletions examples/opensearch/opensearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
planId := "PLAN_ID"

// Create a new API client, that uses default authentication and configuration
Expand Down
5 changes: 2 additions & 3 deletions examples/postgresflex/postgresflex.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Specify the region
region := "REGION"
region := "eu01"

// Create a new API client, that uses default authentication and configuration
postgresflexClient, err := postgresflex.NewAPIClient()
Expand Down
3 changes: 1 addition & 2 deletions examples/rabbitmq/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
planId := "PLAN_ID"

// Create a new API client, that uses default authentication and configuration
Expand Down
3 changes: 1 addition & 2 deletions examples/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
planId := "PLAN_ID"

// Create a new API client, that uses default authentication and configuration
Expand Down
5 changes: 2 additions & 3 deletions examples/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Specify the region
region := "REGION"
region := "eu01"

// Create a new API client, that uses default authentication and configuration
postgresflexClient, err := postgresflex.NewAPIClient()
Expand Down
3 changes: 1 addition & 2 deletions examples/secretsmanager/secretsmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a new API client, that uses default authentication and configuration
secretsmanagerClient, err := secretsmanager.NewAPIClient(
Expand Down
3 changes: 1 addition & 2 deletions examples/serviceaccount/serviceaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a new API client, that uses default authentication and configuration
client, err := serviceaccount.NewAPIClient()
Expand Down
3 changes: 1 addition & 2 deletions examples/serviceenablement/serviceenablement.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Create a new API client, that uses default authentication and configuration
client, err := serviceenablement.NewAPIClient()
Expand Down
5 changes: 2 additions & 3 deletions examples/ske/ske.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Specify the region
region := "REGION"
region := "eu01"

// Create a new API client, that uses default authentication and configuration
skeClient, err := ske.NewAPIClient()
Expand Down
5 changes: 2 additions & 3 deletions examples/sqlserverflex/sqlserverflex.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import (
)

func main() {
// Specify the project ID
projectId := "PROJECT_ID"
projectId := "PROJECT_ID" // the uuid of your STACKIT project

// Specify the region
region := "REGION"
region := "eu01"

// Specify instance configuration options
flavorId := "FLAVOR_ID"
Expand Down
5 changes: 2 additions & 3 deletions examples/waiter/waiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import (
func main() {
ctx := context.Background()

// Specify the project ID and DNS name (must be a valid and unique FQDN)
projectId := "PROJECT_ID"
dnsName := "zoneTest.com"
projectId := "PROJECT_ID" // the uuid of your STACKIT project
dnsName := "zoneTest.com" // DNS name (must be a valid and unique FQDN)

// Create a new API client, that uses default authentication.
dnsClient, err := dns.NewAPIClient()
Expand Down
Loading