Skip to content

Commit

Permalink
feat(2023-01-15): updated the sdk as per the api spec released on 202…
Browse files Browse the repository at this point in the history
…3-01-15 (#64)

Signed-off-by: Ujjwal Kumar <[email protected]>

Signed-off-by: Ujjwal Kumar <[email protected]>
  • Loading branch information
ujjwal-ibm authored Jan 16, 2023
1 parent 96c0942 commit c2db84a
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 130 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/IBM/vpc-go-sdk)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

# IBM Cloud VPC Go SDK Version 0.29.0
# IBM Cloud VPC Go SDK Version 0.30.0
Go client library to interact with the various [IBM Cloud VPC Services APIs](https://cloud.ibm.com/apidocs?category=vpc).

**Note:** Given the current version of all VPC SDKs across supported languages and the current VPC API specification, we retracted the vpc-go-sdk version 1.x to version v0.6.0, which had the same features as v1.0.1.
Consider using v0.29.0 from now on. Refrain from using commands like `go get -u ..` and `go get ..@latest` on go 1.14 and lower as you will not get the latest release.
Consider using v0.30.0 from now on. Refrain from using commands like `go get -u ..` and `go get ..@latest` on go 1.14 and lower as you will not get the latest release.

This SDK uses [Semantic Versioning](https://semver.org), and as such there may be backward-incompatible changes for any new `0.y.z` version.
## Table of Contents
Expand Down Expand Up @@ -64,7 +64,7 @@ Use this command to download and install the VPC Go SDK service to allow your Go
use it:

```
go get github.com/IBM/vpc-go-sdk@v0.29.0
go get github.com/IBM/vpc-go-sdk@v0.30.0
```


Expand All @@ -90,7 +90,7 @@ to your `Gopkg.toml` file. Here is an example:
```
[[constraint]]
name = "github.com/IBM/vpc-go-sdk/"
version = "0.29.0"
version = "0.30.0"
```

Then run `dep ensure`.
Expand Down
2 changes: 1 addition & 1 deletion common/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package common

// Version of the SDK
const Version = "0.29.0"
const Version = "0.30.0"
104 changes: 89 additions & 15 deletions vpcv1/vpc_v1.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2020, 2021, 2022.
* (C) Copyright IBM Corp. 2021, 2022, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,7 +37,7 @@ import (
// VpcV1 : The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual
// server instances, along with subnets, volumes, load balancers, and more.
//
// API Version: 2022-12-27
// API Version: 2023-01-15
type VpcV1 struct {
Service *core.BaseService

Expand Down Expand Up @@ -18319,6 +18319,9 @@ func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadB
if createLoadBalancerOptions.Subnets != nil {
body["subnets"] = createLoadBalancerOptions.Subnets
}
if createLoadBalancerOptions.Datapath != nil {
body["datapath"] = createLoadBalancerOptions.Datapath
}
if createLoadBalancerOptions.Listeners != nil {
body["listeners"] = createLoadBalancerOptions.Listeners
}
Expand Down Expand Up @@ -22876,6 +22879,7 @@ const (
// Constants associated with the BareMetalServer.Status property.
// The status of the bare metal server.
const (
BareMetalServerStatusDeletingConst = "deleting"
BareMetalServerStatusFailedConst = "failed"
BareMetalServerStatusMaintenanceConst = "maintenance"
BareMetalServerStatusPendingConst = "pending"
Expand Down Expand Up @@ -27330,6 +27334,9 @@ type CreateLoadBalancerOptions struct {
// Load balancers in the `network` family allow only one subnet to be specified.
Subnets []SubnetIdentityIntf `json:"subnets" validate:"required"`

// The datapath logging configuration for this load balancer.
Datapath *LoadBalancerLoggingDatapathPrototype `json:"datapath,omitempty"`

// The listeners of this load balancer.
Listeners []LoadBalancerListenerPrototypeLoadBalancerContext `json:"listeners,omitempty"`

Expand All @@ -27338,7 +27345,7 @@ type CreateLoadBalancerOptions struct {
// format, fields and permitted values.
//
// To activate logging, the load balancer profile must support the specified logging type.
Logging *LoadBalancerLogging `json:"logging,omitempty"`
Logging *LoadBalancerLoggingPrototype `json:"logging,omitempty"`

// The name for this load balancer. The name must not be used by another load balancer in the VPC. If unspecified, the
// name will be a hyphenated list of randomly-selected words.
Expand Down Expand Up @@ -27390,14 +27397,20 @@ func (_options *CreateLoadBalancerOptions) SetSubnets(subnets []SubnetIdentityIn
return _options
}

// SetDatapath : Allow user to set Datapath
func (_options *CreateLoadBalancerOptions) SetDatapath(datapath *LoadBalancerLoggingDatapathPrototype) *CreateLoadBalancerOptions {
_options.Datapath = datapath
return _options
}

// SetListeners : Allow user to set Listeners
func (_options *CreateLoadBalancerOptions) SetListeners(listeners []LoadBalancerListenerPrototypeLoadBalancerContext) *CreateLoadBalancerOptions {
_options.Listeners = listeners
return _options
}

// SetLogging : Allow user to set Logging
func (_options *CreateLoadBalancerOptions) SetLogging(logging *LoadBalancerLogging) *CreateLoadBalancerOptions {
func (_options *CreateLoadBalancerOptions) SetLogging(logging *LoadBalancerLoggingPrototype) *CreateLoadBalancerOptions {
_options.Logging = logging
return _options
}
Expand Down Expand Up @@ -41457,6 +41470,7 @@ type InstancePatch struct {
// instance is placed on a dedicated host, the requested profile `family` must be
// the same as the dedicated host `family`.
// - Have the same `vcpu.architecture`.
// - Support the number of network interfaces currently attached to the instance.
Profile InstancePatchProfileIntf `json:"profile,omitempty"`

// The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in
Expand Down Expand Up @@ -41515,6 +41529,7 @@ func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, er
// instance is placed on a dedicated host, the requested profile `family` must be
// the same as the dedicated host `family`.
// - Have the same `vcpu.architecture`.
// - Support the number of network interfaces currently attached to the instance.
//
// Models which "extend" this model:
// - InstancePatchProfileInstanceProfileIdentityByName
Expand Down Expand Up @@ -49486,7 +49501,7 @@ func UnmarshalLoadBalancerListenerReferenceDeleted(m map[string]json.RawMessage,
// LoadBalancerLogging : LoadBalancerLogging struct
type LoadBalancerLogging struct {
// The datapath logging configuration for this load balancer.
Datapath *LoadBalancerLoggingDatapath `json:"datapath,omitempty"`
Datapath *LoadBalancerLoggingDatapath `json:"datapath" validate:"required"`
}

// UnmarshalLoadBalancerLogging unmarshals an instance of LoadBalancerLogging from the specified map of raw messages.
Expand All @@ -49506,18 +49521,43 @@ type LoadBalancerLoggingDatapath struct {
Active *bool `json:"active" validate:"required"`
}

// NewLoadBalancerLoggingDatapath : Instantiate LoadBalancerLoggingDatapath (Generic Model Constructor)
func (*VpcV1) NewLoadBalancerLoggingDatapath(active bool) (_model *LoadBalancerLoggingDatapath, err error) {
_model = &LoadBalancerLoggingDatapath{
Active: core.BoolPtr(active),
// UnmarshalLoadBalancerLoggingDatapath unmarshals an instance of LoadBalancerLoggingDatapath from the specified map of raw messages.
func UnmarshalLoadBalancerLoggingDatapath(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(LoadBalancerLoggingDatapath)
err = core.UnmarshalPrimitive(m, "active", &obj.Active)
if err != nil {
return
}
err = core.ValidateStruct(_model, "required parameters")
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}

// UnmarshalLoadBalancerLoggingDatapath unmarshals an instance of LoadBalancerLoggingDatapath from the specified map of raw messages.
func UnmarshalLoadBalancerLoggingDatapath(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(LoadBalancerLoggingDatapath)
// LoadBalancerLoggingDatapathPatch : The datapath logging configuration for this load balancer.
type LoadBalancerLoggingDatapathPatch struct {
// Indicates whether datapath logging will be active for this load balancer.
Active *bool `json:"active,omitempty"`
}

// UnmarshalLoadBalancerLoggingDatapathPatch unmarshals an instance of LoadBalancerLoggingDatapathPatch from the specified map of raw messages.
func UnmarshalLoadBalancerLoggingDatapathPatch(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(LoadBalancerLoggingDatapathPatch)
err = core.UnmarshalPrimitive(m, "active", &obj.Active)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}

// LoadBalancerLoggingDatapathPrototype : The datapath logging configuration for this load balancer.
type LoadBalancerLoggingDatapathPrototype struct {
// Indicates whether datapath logging will be active for this load balancer.
Active *bool `json:"active,omitempty"`
}

// UnmarshalLoadBalancerLoggingDatapathPrototype unmarshals an instance of LoadBalancerLoggingDatapathPrototype from the specified map of raw messages.
func UnmarshalLoadBalancerLoggingDatapathPrototype(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(LoadBalancerLoggingDatapathPrototype)
err = core.UnmarshalPrimitive(m, "active", &obj.Active)
if err != nil {
return
Expand All @@ -49526,12 +49566,46 @@ func UnmarshalLoadBalancerLoggingDatapath(m map[string]json.RawMessage, result i
return
}

// LoadBalancerLoggingPatch : LoadBalancerLoggingPatch struct
type LoadBalancerLoggingPatch struct {
// The datapath logging configuration for this load balancer.
Datapath *LoadBalancerLoggingDatapathPatch `json:"datapath,omitempty"`
}

// UnmarshalLoadBalancerLoggingPatch unmarshals an instance of LoadBalancerLoggingPatch from the specified map of raw messages.
func UnmarshalLoadBalancerLoggingPatch(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(LoadBalancerLoggingPatch)
err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapathPatch)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}

// LoadBalancerLoggingPrototype : LoadBalancerLoggingPrototype struct
type LoadBalancerLoggingPrototype struct {
// The datapath logging configuration for this load balancer.
Datapath *LoadBalancerLoggingDatapathPrototype `json:"datapath,omitempty"`
}

// UnmarshalLoadBalancerLoggingPrototype unmarshals an instance of LoadBalancerLoggingPrototype from the specified map of raw messages.
func UnmarshalLoadBalancerLoggingPrototype(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(LoadBalancerLoggingPrototype)
err = core.UnmarshalModel(m, "datapath", &obj.Datapath, UnmarshalLoadBalancerLoggingDatapathPrototype)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}

// LoadBalancerPatch : LoadBalancerPatch struct
type LoadBalancerPatch struct {
// The logging configuration to use for this load balancer.
//
// To activate logging, the load balancer profile must support the specified logging type.
Logging *LoadBalancerLogging `json:"logging,omitempty"`
Logging *LoadBalancerLoggingPatch `json:"logging,omitempty"`

// The name for this load balancer. The name must not be used by another load balancer in the VPC.
Name *string `json:"name,omitempty"`
Expand All @@ -49549,7 +49623,7 @@ type LoadBalancerPatch struct {
// UnmarshalLoadBalancerPatch unmarshals an instance of LoadBalancerPatch from the specified map of raw messages.
func UnmarshalLoadBalancerPatch(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(LoadBalancerPatch)
err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLogging)
err = core.UnmarshalModel(m, "logging", &obj.Logging, UnmarshalLoadBalancerLoggingPatch)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion vpcv1/vpc_v1_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// +build examples

/**
* (C) Copyright IBM Corp. 2020, 2021, 2022.
* (C) Copyright IBM Corp. 2021, 2022, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion vpcv1/vpc_v1_integration_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//go:build integration
// +build integration

/**
* (C) Copyright IBM Corp. 2020, 2021, 2022.
* (C) Copyright IBM Corp. 2021, 2022, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion vpcv1/vpc_v1_integration_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// +build integration

/**
* (C) Copyright IBM Corp. 2020, 2021, 2022.
* (C) Copyright IBM Corp. 2021, 2022, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion vpcv1/vpc_v1_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2020, 2021, 2022.
* (C) Copyright IBM Corp. 2021, 2022, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit c2db84a

Please sign in to comment.