Skip to content

Commit 7855708

Browse files
authored
Release V1.7.0 (#114)
Releasing version 1.7.0
1 parent 483be76 commit 7855708

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3811
-10
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66

7+
## 1.7.0 - 2018-06-14
8+
### Added
9+
- Support for the Container Engine service. A sample showing how to use this service from the SDK is available [Github](https://github.com/oracle/oci-go-sdk/tree/master/example/example_containerengine_test.go)
10+
11+
### Fixed
12+
- Empty string was send to backend service for optional enum if it's not set
13+
714
## 1.6.0 - 2018-05-31
815
### Added
916
- Support for the "soft shutdown" instance action in the Compute service

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
DOC_SERVER_URL=https:\/\/docs.us-phoenix-1.oraclecloud.com
22

3-
GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email
3+
GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine
44
NON_GEN_TARGETS = common common/auth
55
TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS)
66

common/http.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func isNillableType(value *reflect.Value) bool {
128128
return false
129129
}
130130

131-
// omitNilFieldsInJSON, removes json keys whose struct value is nil, and the field is tag with the json and
131+
// omitNilFieldsInJSON, removes json keys whose struct value is nil, and the field is tagged with the json and
132132
// mandatory:false tags
133133
func omitNilFieldsInJSON(data interface{}, value reflect.Value) (interface{}, error) {
134134
switch value.Kind() {
@@ -160,6 +160,12 @@ func omitNilFieldsInJSON(data interface{}, value reflect.Value) (interface{}, er
160160
continue
161161
}
162162

163+
// Check to make sure the field is part of the json representation of the value
164+
if _, contains := jsonMap[jsonFieldName]; !contains {
165+
Debugf("Field %s is not present in json, omitting", jsonFieldName)
166+
continue
167+
}
168+
163169
if currentFieldValue.Type() == timeType || currentFieldValue.Type() == timeTypePtr {
164170
continue
165171
}

common/http_test.go

+9-5
Original file line numberDiff line numberDiff line change
@@ -916,31 +916,35 @@ func TestOmitFieldsInJson_SimpleStructWithMapStruct(t *testing.T) {
916916
}
917917

918918
func TestOmitFieldsInJson_removeFields(t *testing.T) {
919+
type MyEnum string
919920
type InSstruct struct {
920921
AString *string `mandatory:"false" json:"a"`
921922
ANilString *string `mandatory:"false" json:"anil"`
923+
ASecondEnum MyEnum `mandatory:"false" json:"secenum,omitempty"`
924+
ThirdEnum MyEnum `mandatory:"false" json:"tnum,omitempty"`
922925
EmptyNumbers []int `mandatory:"false" json:"aempty"`
923926
}
924927
type Nested struct {
925-
N *string `mandatory:"false" json:"n"`
926-
//Numbers []int `mandatory:"false" json:"numbers"`
928+
N *string `mandatory:"false" json:"n"`
929+
AnEnum MyEnum `mandatory:"false" json:"anenum,omitempty"`
930+
AnEnum2 MyEnum `mandatory:"false" json:"anenum2,omitempty"`
927931
ZComplex map[string]InSstruct `mandatory:"false" json:"complex"`
928932
}
929933
val := ""
930934
val2 := "two"
931935
//numbers := []int{1, 3}
932936
//s := Nested{N:&val, Numbers: numbers, ZComplex:InSstruct{AString:&val, EmptyNumbers:[]int{}}}
933937
data := make(map[string]InSstruct)
934-
data["one"] = InSstruct{AString: &val, EmptyNumbers: []int{}}
938+
data["one"] = InSstruct{AString: &val, EmptyNumbers: []int{}, ThirdEnum: MyEnum("enum")}
935939
data["two"] = InSstruct{AString: &val2, EmptyNumbers: []int{1}}
936940
data["ten"] = InSstruct{AString: &val2}
937941

938-
s := Nested{ZComplex: data}
942+
s := Nested{ZComplex: data, AnEnum2: MyEnum("hello")}
939943
jsonIn, _ := json.Marshal(s)
940944
sVal := reflect.ValueOf(s)
941945
jsonRet, err := removeNilFieldsInJSONWithTaggedStruct(jsonIn, sVal)
942946
assert.NoError(t, err)
943-
assert.Equal(t, `{"complex":{"one":{"a":"","aempty":[]},"ten":{"a":"two"},"two":{"a":"two","aempty":[1]}}}`, string(jsonRet))
947+
assert.Equal(t, `{"anenum2":"hello","complex":{"one":{"a":"","aempty":[],"tnum":"enum"},"ten":{"a":"two"},"two":{"a":"two","aempty":[1]}}}`, string(jsonRet))
944948
}
945949

946950
func TestOmitFieldsInJson_SimpleStructWithTime(t *testing.T) {

common/version.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

containerengine/add_on_options.go

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
// Code generated. DO NOT EDIT.
3+
4+
// Container Engine for Kubernetes API
5+
//
6+
// Container Engine for Kubernetes API
7+
//
8+
9+
package containerengine
10+
11+
import (
12+
"github.com/oracle/oci-go-sdk/common"
13+
)
14+
15+
// AddOnOptions The properties that define options for supported add-ons.
16+
type AddOnOptions struct {
17+
18+
// Whether or not to enable the Kubernetes Dashboard add-on.
19+
IsKubernetesDashboardEnabled *bool `mandatory:"false" json:"isKubernetesDashboardEnabled"`
20+
21+
// Whether or not to enable the Tiller add-on.
22+
IsTillerEnabled *bool `mandatory:"false" json:"isTillerEnabled"`
23+
}
24+
25+
func (m AddOnOptions) String() string {
26+
return common.PointerString(m)
27+
}

containerengine/cluster.go

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
// Code generated. DO NOT EDIT.
3+
4+
// Container Engine for Kubernetes API
5+
//
6+
// Container Engine for Kubernetes API
7+
//
8+
9+
package containerengine
10+
11+
import (
12+
"github.com/oracle/oci-go-sdk/common"
13+
)
14+
15+
// Cluster A Kubernetes cluster.
16+
type Cluster struct {
17+
18+
// The OCID of the cluster.
19+
Id *string `mandatory:"false" json:"id"`
20+
21+
// The name of the cluster.
22+
Name *string `mandatory:"false" json:"name"`
23+
24+
// The OCID of the compartment in which the cluster exists.
25+
CompartmentId *string `mandatory:"false" json:"compartmentId"`
26+
27+
// The OCID of the virtual cloud network (VCN) in which the cluster exists.
28+
VcnId *string `mandatory:"false" json:"vcnId"`
29+
30+
// The version of Kubernetes running on the cluster masters.
31+
KubernetesVersion *string `mandatory:"false" json:"kubernetesVersion"`
32+
33+
// Optional attributes for the cluster.
34+
Options *ClusterCreateOptions `mandatory:"false" json:"options"`
35+
36+
// Metadata about the cluster.
37+
Metadata *ClusterMetadata `mandatory:"false" json:"metadata"`
38+
39+
// The state of the cluster masters.
40+
LifecycleState ClusterLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"`
41+
42+
// Details about the state of the cluster masters.
43+
LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"`
44+
45+
// Endpoints served up by the cluster masters.
46+
Endpoints *ClusterEndpoints `mandatory:"false" json:"endpoints"`
47+
48+
// Available Kubernetes versions to which the clusters masters may be upgraded.
49+
AvailableKubernetesUpgrades []string `mandatory:"false" json:"availableKubernetesUpgrades"`
50+
}
51+
52+
func (m Cluster) String() string {
53+
return common.PointerString(m)
54+
}
55+
56+
// ClusterLifecycleStateEnum Enum with underlying type: string
57+
type ClusterLifecycleStateEnum string
58+
59+
// Set of constants representing the allowable values for ClusterLifecycleState
60+
const (
61+
ClusterLifecycleStateCreating ClusterLifecycleStateEnum = "CREATING"
62+
ClusterLifecycleStateActive ClusterLifecycleStateEnum = "ACTIVE"
63+
ClusterLifecycleStateFailed ClusterLifecycleStateEnum = "FAILED"
64+
ClusterLifecycleStateDeleting ClusterLifecycleStateEnum = "DELETING"
65+
ClusterLifecycleStateDeleted ClusterLifecycleStateEnum = "DELETED"
66+
ClusterLifecycleStateUpdating ClusterLifecycleStateEnum = "UPDATING"
67+
)
68+
69+
var mappingClusterLifecycleState = map[string]ClusterLifecycleStateEnum{
70+
"CREATING": ClusterLifecycleStateCreating,
71+
"ACTIVE": ClusterLifecycleStateActive,
72+
"FAILED": ClusterLifecycleStateFailed,
73+
"DELETING": ClusterLifecycleStateDeleting,
74+
"DELETED": ClusterLifecycleStateDeleted,
75+
"UPDATING": ClusterLifecycleStateUpdating,
76+
}
77+
78+
// GetClusterLifecycleStateEnumValues Enumerates the set of values for ClusterLifecycleState
79+
func GetClusterLifecycleStateEnumValues() []ClusterLifecycleStateEnum {
80+
values := make([]ClusterLifecycleStateEnum, 0)
81+
for _, v := range mappingClusterLifecycleState {
82+
values = append(values, v)
83+
}
84+
return values
85+
}
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
// Code generated. DO NOT EDIT.
3+
4+
// Container Engine for Kubernetes API
5+
//
6+
// Container Engine for Kubernetes API
7+
//
8+
9+
package containerengine
10+
11+
import (
12+
"github.com/oracle/oci-go-sdk/common"
13+
)
14+
15+
// ClusterCreateOptions The properties that define extra options for a cluster.
16+
type ClusterCreateOptions struct {
17+
18+
// The OCIDs of the subnets used for Kubernetes services load balancers.
19+
ServiceLbSubnetIds []string `mandatory:"false" json:"serviceLbSubnetIds"`
20+
21+
// Network configuration for Kubernetes.
22+
KubernetesNetworkConfig *KubernetesNetworkConfig `mandatory:"false" json:"kubernetesNetworkConfig"`
23+
24+
// Configurable cluster add-ons
25+
AddOns *AddOnOptions `mandatory:"false" json:"addOns"`
26+
}
27+
28+
func (m ClusterCreateOptions) String() string {
29+
return common.PointerString(m)
30+
}

containerengine/cluster_endpoints.go

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
// Code generated. DO NOT EDIT.
3+
4+
// Container Engine for Kubernetes API
5+
//
6+
// Container Engine for Kubernetes API
7+
//
8+
9+
package containerengine
10+
11+
import (
12+
"github.com/oracle/oci-go-sdk/common"
13+
)
14+
15+
// ClusterEndpoints The properties that define endpoints for a cluster.
16+
type ClusterEndpoints struct {
17+
18+
// The Kubernetes API server endpoint.
19+
Kubernetes *string `mandatory:"false" json:"kubernetes"`
20+
}
21+
22+
func (m ClusterEndpoints) String() string {
23+
return common.PointerString(m)
24+
}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
// Code generated. DO NOT EDIT.
3+
4+
// Container Engine for Kubernetes API
5+
//
6+
// Container Engine for Kubernetes API
7+
//
8+
9+
package containerengine
10+
11+
import (
12+
"github.com/oracle/oci-go-sdk/common"
13+
)
14+
15+
// ClusterLifecycleState The lifecycle state of a cluster.
16+
type ClusterLifecycleState struct {
17+
}
18+
19+
func (m ClusterLifecycleState) String() string {
20+
return common.PointerString(m)
21+
}

containerengine/cluster_metadata.go

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
// Code generated. DO NOT EDIT.
3+
4+
// Container Engine for Kubernetes API
5+
//
6+
// Container Engine for Kubernetes API
7+
//
8+
9+
package containerengine
10+
11+
import (
12+
"github.com/oracle/oci-go-sdk/common"
13+
)
14+
15+
// ClusterMetadata The properties that define meta data for a cluster.
16+
type ClusterMetadata struct {
17+
18+
// The time the cluster was created.
19+
TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
20+
21+
// The user who created the cluster.
22+
CreatedByUserId *string `mandatory:"false" json:"createdByUserId"`
23+
24+
// The OCID of the work request which created the cluster.
25+
CreatedByWorkRequestId *string `mandatory:"false" json:"createdByWorkRequestId"`
26+
27+
// The time the cluster was deleted.
28+
TimeDeleted *common.SDKTime `mandatory:"false" json:"timeDeleted"`
29+
30+
// The user who deleted the cluster.
31+
DeletedByUserId *string `mandatory:"false" json:"deletedByUserId"`
32+
33+
// The OCID of the work request which deleted the cluster.
34+
DeletedByWorkRequestId *string `mandatory:"false" json:"deletedByWorkRequestId"`
35+
36+
// The time the cluster was updated.
37+
TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"`
38+
39+
// The user who updated the cluster.
40+
UpdatedByUserId *string `mandatory:"false" json:"updatedByUserId"`
41+
42+
// The OCID of the work request which updated the cluster.
43+
UpdatedByWorkRequestId *string `mandatory:"false" json:"updatedByWorkRequestId"`
44+
}
45+
46+
func (m ClusterMetadata) String() string {
47+
return common.PointerString(m)
48+
}

containerengine/cluster_options.go

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
// Code generated. DO NOT EDIT.
3+
4+
// Container Engine for Kubernetes API
5+
//
6+
// Container Engine for Kubernetes API
7+
//
8+
9+
package containerengine
10+
11+
import (
12+
"github.com/oracle/oci-go-sdk/common"
13+
)
14+
15+
// ClusterOptions Options for creating or updating clusters.
16+
type ClusterOptions struct {
17+
18+
// Available Kubernetes versions.
19+
KubernetesVersions []string `mandatory:"false" json:"kubernetesVersions"`
20+
}
21+
22+
func (m ClusterOptions) String() string {
23+
return common.PointerString(m)
24+
}

0 commit comments

Comments
 (0)