Skip to content

Commit a2ded71

Browse files
authored
Merge pull request #87 in SDK/oci-go-sdk from merge_to_github2018-06-27-18-43-52 to github (#115)
Releasing version V1.8.0
1 parent 7855708 commit a2ded71

Some content is hidden

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

41 files changed

+2764
-39
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ 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.8.0 - 2018-06-28
8+
### Added
9+
- Support for service gateway management in the Networking service
10+
- Support for backup and clone of boot volumes in the Block Storage service
11+
712
## 1.7.0 - 2018-06-14
813
### Added
914
- 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)

common/version.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
// Code generated. DO NOT EDIT.
3+
4+
package core
5+
6+
import (
7+
"github.com/oracle/oci-go-sdk/common"
8+
"net/http"
9+
)
10+
11+
// AttachServiceIdRequest wrapper for the AttachServiceId operation
12+
type AttachServiceIdRequest struct {
13+
14+
// The service gateway's OCID (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
15+
ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"`
16+
17+
// ServiceId of Service to be attached to a Service Gateway.
18+
AttachServiceDetails ServiceIdRequestDetails `contributesTo:"body"`
19+
20+
// For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
21+
// parameter to the value of the etag from a previous GET or POST response for that resource. The resource
22+
// will be updated or deleted only if the etag you provide matches the resource's current etag value.
23+
IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"`
24+
25+
// Unique Oracle-assigned identifier for the request.
26+
// If you need to contact Oracle about a particular request, please provide the request ID.
27+
OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`
28+
29+
// Metadata about the request. This information will not be transmitted to the service, but
30+
// represents information that the SDK will consume to drive retry behavior.
31+
RequestMetadata common.RequestMetadata
32+
}
33+
34+
func (request AttachServiceIdRequest) String() string {
35+
return common.PointerString(request)
36+
}
37+
38+
// HTTPRequest implements the OCIRequest interface
39+
func (request AttachServiceIdRequest) HTTPRequest(method, path string) (http.Request, error) {
40+
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
41+
}
42+
43+
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
44+
func (request AttachServiceIdRequest) RetryPolicy() *common.RetryPolicy {
45+
return request.RequestMetadata.RetryPolicy
46+
}
47+
48+
// AttachServiceIdResponse wrapper for the AttachServiceId operation
49+
type AttachServiceIdResponse struct {
50+
51+
// The underlying http response
52+
RawResponse *http.Response
53+
54+
// The ServiceGateway instance
55+
ServiceGateway `presentIn:"body"`
56+
57+
// Unique Oracle-assigned identifier for the request. If you need to contact Oracle about
58+
// a particular request, please provide the request ID.
59+
OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
60+
}
61+
62+
func (response AttachServiceIdResponse) String() string {
63+
return common.PointerString(response)
64+
}
65+
66+
// HTTPResponse implements the OCIResponse interface
67+
func (response AttachServiceIdResponse) HTTPResponse() *http.Response {
68+
return response.RawResponse
69+
}

core/boot_volume.go

+63
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
package core
1010

1111
import (
12+
"encoding/json"
1213
"github.com/oracle/oci-go-sdk/common"
1314
)
1415

@@ -39,16 +40,34 @@ type BootVolume struct {
3940
// The date and time the boot volume was created. Format defined by RFC3339.
4041
TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
4142

43+
// Defined tags for this resource. Each key is predefined and scoped to a namespace.
44+
// For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
45+
// Example: `{"Operations": {"CostCenter": "42"}}`
46+
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
47+
4248
// A user-friendly name. Does not have to be unique, and it's changeable.
4349
// Avoid entering confidential information.
4450
DisplayName *string `mandatory:"false" json:"displayName"`
4551

52+
// Free-form tags for this resource. Each tag is a simple key-value pair with no
53+
// predefined name, type, or namespace. For more information, see
54+
// Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
55+
// Example: `{"Department": "Finance"}`
56+
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
57+
4658
// The image OCID used to create the boot volume.
4759
ImageId *string `mandatory:"false" json:"imageId"`
4860

61+
// Specifies whether the boot volume's data has finished copying from the source boot volume or boot volume backup.
62+
IsHydrated *bool `mandatory:"false" json:"isHydrated"`
63+
4964
// The size of the boot volume in GBs.
5065
SizeInGBs *int `mandatory:"false" json:"sizeInGBs"`
5166

67+
// The boot volume source, either an existing boot volume in the same Availability Domain or a boot volume backup.
68+
// If null, this means that the boot volume was created from an image.
69+
SourceDetails BootVolumeSourceDetails `mandatory:"false" json:"sourceDetails"`
70+
5271
// The OCID of the source volume group.
5372
VolumeGroupId *string `mandatory:"false" json:"volumeGroupId"`
5473
}
@@ -57,6 +76,50 @@ func (m BootVolume) String() string {
5776
return common.PointerString(m)
5877
}
5978

79+
// UnmarshalJSON unmarshals from json
80+
func (m *BootVolume) UnmarshalJSON(data []byte) (e error) {
81+
model := struct {
82+
DefinedTags map[string]map[string]interface{} `json:"definedTags"`
83+
DisplayName *string `json:"displayName"`
84+
FreeformTags map[string]string `json:"freeformTags"`
85+
ImageId *string `json:"imageId"`
86+
IsHydrated *bool `json:"isHydrated"`
87+
SizeInGBs *int `json:"sizeInGBs"`
88+
SourceDetails bootvolumesourcedetails `json:"sourceDetails"`
89+
VolumeGroupId *string `json:"volumeGroupId"`
90+
AvailabilityDomain *string `json:"availabilityDomain"`
91+
CompartmentId *string `json:"compartmentId"`
92+
Id *string `json:"id"`
93+
LifecycleState BootVolumeLifecycleStateEnum `json:"lifecycleState"`
94+
SizeInMBs *int `json:"sizeInMBs"`
95+
TimeCreated *common.SDKTime `json:"timeCreated"`
96+
}{}
97+
98+
e = json.Unmarshal(data, &model)
99+
if e != nil {
100+
return
101+
}
102+
m.DefinedTags = model.DefinedTags
103+
m.DisplayName = model.DisplayName
104+
m.FreeformTags = model.FreeformTags
105+
m.ImageId = model.ImageId
106+
m.IsHydrated = model.IsHydrated
107+
m.SizeInGBs = model.SizeInGBs
108+
nn, e := model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData)
109+
if e != nil {
110+
return
111+
}
112+
m.SourceDetails = nn.(BootVolumeSourceDetails)
113+
m.VolumeGroupId = model.VolumeGroupId
114+
m.AvailabilityDomain = model.AvailabilityDomain
115+
m.CompartmentId = model.CompartmentId
116+
m.Id = model.Id
117+
m.LifecycleState = model.LifecycleState
118+
m.SizeInMBs = model.SizeInMBs
119+
m.TimeCreated = model.TimeCreated
120+
return
121+
}
122+
60123
// BootVolumeLifecycleStateEnum Enum with underlying type: string
61124
type BootVolumeLifecycleStateEnum string
62125

core/boot_volume_backup.go

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
// Code generated. DO NOT EDIT.
3+
4+
// Core Services API
5+
//
6+
// APIs for Networking Service, Compute Service, and Block Volume Service.
7+
//
8+
9+
package core
10+
11+
import (
12+
"github.com/oracle/oci-go-sdk/common"
13+
)
14+
15+
// BootVolumeBackup A point-in-time copy of a boot volume that can then be used to create
16+
// a new boot volume or recover a boot volume. For more information, see Overview
17+
// of Boot Volume Backups (https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/bootvolumebackups.htm)
18+
// To use any of the API operations, you must be authorized in an IAM policy.
19+
// If you're not authorized, talk to an administrator. If you're an administrator
20+
// who needs to write policies to give users access, see Getting Started with
21+
// Policies (https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).
22+
type BootVolumeBackup struct {
23+
24+
// The OCID of the compartment that contains the boot volume backup.
25+
CompartmentId *string `mandatory:"true" json:"compartmentId"`
26+
27+
// A user-friendly name for the boot volume backup. Does not have to be unique and it's changeable.
28+
// Avoid entering confidential information.
29+
DisplayName *string `mandatory:"true" json:"displayName"`
30+
31+
// The OCID of the boot volume backup.
32+
Id *string `mandatory:"true" json:"id"`
33+
34+
// The current state of a boot volume backup.
35+
LifecycleState BootVolumeBackupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
36+
37+
// The date and time the boot volume backup was created. This is the time the actual point-in-time image
38+
// of the volume data was taken. Format defined by RFC3339.
39+
TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
40+
41+
// The OCID of the boot volume.
42+
BootVolumeId *string `mandatory:"false" json:"bootVolumeId"`
43+
44+
// Defined tags for this resource. Each key is predefined and scoped to a namespace.
45+
// For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
46+
// Example: `{"Operations": {"CostCenter": "42"}}`
47+
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
48+
49+
// The date and time the volume backup will expire and be automatically deleted.
50+
// Format defined by RFC3339. This parameter will always be present for backups that
51+
// were created automatically by a scheduled-backup policy. For manually created backups,
52+
// it will be absent, signifying that there is no expiration time and the backup will
53+
// last forever until manually deleted.
54+
ExpirationTime *common.SDKTime `mandatory:"false" json:"expirationTime"`
55+
56+
// Free-form tags for this resource. Each tag is a simple key-value pair with no
57+
// predefined name, type, or namespace. For more information, see
58+
// Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
59+
// Example: `{"Department": "Finance"}`
60+
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
61+
62+
// The image OCID used to create the boot volume the backup is taken from.
63+
ImageId *string `mandatory:"false" json:"imageId"`
64+
65+
// The size of the boot volume, in GBs.
66+
SizeInGBs *int `mandatory:"false" json:"sizeInGBs"`
67+
68+
// Specifies whether the backup was created manually, or via scheduled backup policy.
69+
SourceType BootVolumeBackupSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"`
70+
71+
// The date and time the request to create the boot volume backup was received. Format defined by RFC3339.
72+
TimeRequestReceived *common.SDKTime `mandatory:"false" json:"timeRequestReceived"`
73+
74+
// The type of a volume backup.
75+
Type BootVolumeBackupTypeEnum `mandatory:"false" json:"type,omitempty"`
76+
77+
// The size used by the backup, in GBs. It is typically smaller than sizeInGBs, depending on the space
78+
// consumed on the boot volume and whether the backup is full or incremental.
79+
UniqueSizeInGBs *int `mandatory:"false" json:"uniqueSizeInGBs"`
80+
}
81+
82+
func (m BootVolumeBackup) String() string {
83+
return common.PointerString(m)
84+
}
85+
86+
// BootVolumeBackupLifecycleStateEnum Enum with underlying type: string
87+
type BootVolumeBackupLifecycleStateEnum string
88+
89+
// Set of constants representing the allowable values for BootVolumeBackupLifecycleState
90+
const (
91+
BootVolumeBackupLifecycleStateCreating BootVolumeBackupLifecycleStateEnum = "CREATING"
92+
BootVolumeBackupLifecycleStateAvailable BootVolumeBackupLifecycleStateEnum = "AVAILABLE"
93+
BootVolumeBackupLifecycleStateTerminating BootVolumeBackupLifecycleStateEnum = "TERMINATING"
94+
BootVolumeBackupLifecycleStateTerminated BootVolumeBackupLifecycleStateEnum = "TERMINATED"
95+
BootVolumeBackupLifecycleStateFaulty BootVolumeBackupLifecycleStateEnum = "FAULTY"
96+
BootVolumeBackupLifecycleStateRequestReceived BootVolumeBackupLifecycleStateEnum = "REQUEST_RECEIVED"
97+
)
98+
99+
var mappingBootVolumeBackupLifecycleState = map[string]BootVolumeBackupLifecycleStateEnum{
100+
"CREATING": BootVolumeBackupLifecycleStateCreating,
101+
"AVAILABLE": BootVolumeBackupLifecycleStateAvailable,
102+
"TERMINATING": BootVolumeBackupLifecycleStateTerminating,
103+
"TERMINATED": BootVolumeBackupLifecycleStateTerminated,
104+
"FAULTY": BootVolumeBackupLifecycleStateFaulty,
105+
"REQUEST_RECEIVED": BootVolumeBackupLifecycleStateRequestReceived,
106+
}
107+
108+
// GetBootVolumeBackupLifecycleStateEnumValues Enumerates the set of values for BootVolumeBackupLifecycleState
109+
func GetBootVolumeBackupLifecycleStateEnumValues() []BootVolumeBackupLifecycleStateEnum {
110+
values := make([]BootVolumeBackupLifecycleStateEnum, 0)
111+
for _, v := range mappingBootVolumeBackupLifecycleState {
112+
values = append(values, v)
113+
}
114+
return values
115+
}
116+
117+
// BootVolumeBackupSourceTypeEnum Enum with underlying type: string
118+
type BootVolumeBackupSourceTypeEnum string
119+
120+
// Set of constants representing the allowable values for BootVolumeBackupSourceType
121+
const (
122+
BootVolumeBackupSourceTypeManual BootVolumeBackupSourceTypeEnum = "MANUAL"
123+
BootVolumeBackupSourceTypeScheduled BootVolumeBackupSourceTypeEnum = "SCHEDULED"
124+
)
125+
126+
var mappingBootVolumeBackupSourceType = map[string]BootVolumeBackupSourceTypeEnum{
127+
"MANUAL": BootVolumeBackupSourceTypeManual,
128+
"SCHEDULED": BootVolumeBackupSourceTypeScheduled,
129+
}
130+
131+
// GetBootVolumeBackupSourceTypeEnumValues Enumerates the set of values for BootVolumeBackupSourceType
132+
func GetBootVolumeBackupSourceTypeEnumValues() []BootVolumeBackupSourceTypeEnum {
133+
values := make([]BootVolumeBackupSourceTypeEnum, 0)
134+
for _, v := range mappingBootVolumeBackupSourceType {
135+
values = append(values, v)
136+
}
137+
return values
138+
}
139+
140+
// BootVolumeBackupTypeEnum Enum with underlying type: string
141+
type BootVolumeBackupTypeEnum string
142+
143+
// Set of constants representing the allowable values for BootVolumeBackupType
144+
const (
145+
BootVolumeBackupTypeFull BootVolumeBackupTypeEnum = "FULL"
146+
BootVolumeBackupTypeIncremental BootVolumeBackupTypeEnum = "INCREMENTAL"
147+
)
148+
149+
var mappingBootVolumeBackupType = map[string]BootVolumeBackupTypeEnum{
150+
"FULL": BootVolumeBackupTypeFull,
151+
"INCREMENTAL": BootVolumeBackupTypeIncremental,
152+
}
153+
154+
// GetBootVolumeBackupTypeEnumValues Enumerates the set of values for BootVolumeBackupType
155+
func GetBootVolumeBackupTypeEnumValues() []BootVolumeBackupTypeEnum {
156+
values := make([]BootVolumeBackupTypeEnum, 0)
157+
for _, v := range mappingBootVolumeBackupType {
158+
values = append(values, v)
159+
}
160+
return values
161+
}

0 commit comments

Comments
 (0)