Skip to content

Commit 526bc2b

Browse files
authored
Releasing version V1.3.0 (#107)
1 parent ad5c34e commit 526bc2b

File tree

425 files changed

+17602
-1778
lines changed

Some content is hidden

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

425 files changed

+17602
-1778
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
.vscode/*
1111
target/
1212
bin/
13+
temp/

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ 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+
8+
## 1.3.0 - 2018-04-19
9+
### Added
10+
- Support for retry on OCI service APIs. Example can be found on [Github](https://github.com/oracle/oci-go-sdk/tree/master/example/example_retry_test.go)
11+
- Support for tagging DbSystem and Database resources in the Database Service
12+
- Support for filtering by DbSystemId in ListDbVersions operation in Database Service
13+
14+
### Fixed
15+
- Fixed a request signing bug for PatchZoneRecords API
16+
- Fixed a bug in DebugLn
17+
718
## 1.2.0 - 2018-04-05
819
### Added
920
- Support for Email Delivery Service. Example can be found on [Github](https://github.com/oracle/oci-go-sdk/tree/master/example/example_email_test.go)

audit/audit_client.go

+75-12
Original file line numberDiff line numberDiff line change
@@ -60,54 +60,117 @@ func (client *AuditClient) ConfigurationProvider() *common.ConfigurationProvider
6060

6161
// GetConfiguration Get the configuration
6262
func (client AuditClient) GetConfiguration(ctx context.Context, request GetConfigurationRequest) (response GetConfigurationResponse, err error) {
63-
httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/configuration", request)
63+
var ociResponse common.OCIResponse
64+
policy := common.NoRetryPolicy()
65+
if request.RetryPolicy() != nil {
66+
policy = *request.RetryPolicy()
67+
}
68+
ociResponse, err = common.Retry(ctx, request, client.getConfiguration, policy)
6469
if err != nil {
6570
return
6671
}
72+
if convertedResponse, ok := ociResponse.(GetConfigurationResponse); ok {
73+
response = convertedResponse
74+
} else {
75+
err = fmt.Errorf("failed to convert OCIResponse into GetConfigurationResponse")
76+
}
77+
return
78+
}
79+
80+
// getConfiguration implements the OCIOperation interface (enables retrying operations)
81+
func (client AuditClient) getConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {
82+
httpRequest, err := request.HTTPRequest(http.MethodGet, "/configuration")
83+
if err != nil {
84+
return nil, err
85+
}
6786

68-
httpResponse, err := client.Call(ctx, &httpRequest)
87+
var response GetConfigurationResponse
88+
var httpResponse *http.Response
89+
httpResponse, err = client.Call(ctx, &httpRequest)
6990
defer common.CloseBodyIfValid(httpResponse)
7091
response.RawResponse = httpResponse
7192
if err != nil {
72-
return
93+
return response, err
7394
}
7495

7596
err = common.UnmarshalResponse(httpResponse, &response)
76-
return
97+
return response, err
7798
}
7899

79100
// ListEvents Returns all audit events for the specified compartment that were processed within the specified time range.
80101
func (client AuditClient) ListEvents(ctx context.Context, request ListEventsRequest) (response ListEventsResponse, err error) {
81-
httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, "/auditEvents", request)
102+
var ociResponse common.OCIResponse
103+
policy := common.NoRetryPolicy()
104+
if request.RetryPolicy() != nil {
105+
policy = *request.RetryPolicy()
106+
}
107+
ociResponse, err = common.Retry(ctx, request, client.listEvents, policy)
82108
if err != nil {
83109
return
84110
}
111+
if convertedResponse, ok := ociResponse.(ListEventsResponse); ok {
112+
response = convertedResponse
113+
} else {
114+
err = fmt.Errorf("failed to convert OCIResponse into ListEventsResponse")
115+
}
116+
return
117+
}
85118

86-
httpResponse, err := client.Call(ctx, &httpRequest)
119+
// listEvents implements the OCIOperation interface (enables retrying operations)
120+
func (client AuditClient) listEvents(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {
121+
httpRequest, err := request.HTTPRequest(http.MethodGet, "/auditEvents")
122+
if err != nil {
123+
return nil, err
124+
}
125+
126+
var response ListEventsResponse
127+
var httpResponse *http.Response
128+
httpResponse, err = client.Call(ctx, &httpRequest)
87129
defer common.CloseBodyIfValid(httpResponse)
88130
response.RawResponse = httpResponse
89131
if err != nil {
90-
return
132+
return response, err
91133
}
92134

93135
err = common.UnmarshalResponse(httpResponse, &response)
94-
return
136+
return response, err
95137
}
96138

97139
// UpdateConfiguration Update the configuration
98140
func (client AuditClient) UpdateConfiguration(ctx context.Context, request UpdateConfigurationRequest) (response UpdateConfigurationResponse, err error) {
99-
httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPut, "/configuration", request)
141+
var ociResponse common.OCIResponse
142+
policy := common.NoRetryPolicy()
143+
if request.RetryPolicy() != nil {
144+
policy = *request.RetryPolicy()
145+
}
146+
ociResponse, err = common.Retry(ctx, request, client.updateConfiguration, policy)
100147
if err != nil {
101148
return
102149
}
150+
if convertedResponse, ok := ociResponse.(UpdateConfigurationResponse); ok {
151+
response = convertedResponse
152+
} else {
153+
err = fmt.Errorf("failed to convert OCIResponse into UpdateConfigurationResponse")
154+
}
155+
return
156+
}
157+
158+
// updateConfiguration implements the OCIOperation interface (enables retrying operations)
159+
func (client AuditClient) updateConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {
160+
httpRequest, err := request.HTTPRequest(http.MethodPut, "/configuration")
161+
if err != nil {
162+
return nil, err
163+
}
103164

104-
httpResponse, err := client.Call(ctx, &httpRequest)
165+
var response UpdateConfigurationResponse
166+
var httpResponse *http.Response
167+
httpResponse, err = client.Call(ctx, &httpRequest)
105168
defer common.CloseBodyIfValid(httpResponse)
106169
response.RawResponse = httpResponse
107170
if err != nil {
108-
return
171+
return response, err
109172
}
110173

111174
err = common.UnmarshalResponse(httpResponse, &response)
112-
return
175+
return response, err
113176
}

audit/get_configuration_request_response.go

+19
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,26 @@ type GetConfigurationRequest struct {
1313

1414
// ID of the root compartment (tenancy)
1515
CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"`
16+
17+
// Metadata about the request. This information will not be transmitted to the service, but
18+
// represents information that the SDK will consume to drive retry behavior.
19+
RequestMetadata common.RequestMetadata
1620
}
1721

1822
func (request GetConfigurationRequest) String() string {
1923
return common.PointerString(request)
2024
}
2125

26+
// HTTPRequest implements the OCIRequest interface
27+
func (request GetConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) {
28+
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
29+
}
30+
31+
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
32+
func (request GetConfigurationRequest) RetryPolicy() *common.RetryPolicy {
33+
return request.RequestMetadata.RetryPolicy
34+
}
35+
2236
// GetConfigurationResponse wrapper for the GetConfiguration operation
2337
type GetConfigurationResponse struct {
2438

@@ -32,3 +46,8 @@ type GetConfigurationResponse struct {
3246
func (response GetConfigurationResponse) String() string {
3347
return common.PointerString(response)
3448
}
49+
50+
// HTTPResponse implements the OCIResponse interface
51+
func (response GetConfigurationResponse) HTTPResponse() *http.Response {
52+
return response.RawResponse
53+
}

audit/list_events_request_response.go

+19
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,26 @@ type ListEventsRequest struct {
3030
// Unique Oracle-assigned identifier for the request.
3131
// If you need to contact Oracle about a particular request, please provide the request ID.
3232
OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`
33+
34+
// Metadata about the request. This information will not be transmitted to the service, but
35+
// represents information that the SDK will consume to drive retry behavior.
36+
RequestMetadata common.RequestMetadata
3337
}
3438

3539
func (request ListEventsRequest) String() string {
3640
return common.PointerString(request)
3741
}
3842

43+
// HTTPRequest implements the OCIRequest interface
44+
func (request ListEventsRequest) HTTPRequest(method, path string) (http.Request, error) {
45+
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
46+
}
47+
48+
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
49+
func (request ListEventsRequest) RetryPolicy() *common.RetryPolicy {
50+
return request.RequestMetadata.RetryPolicy
51+
}
52+
3953
// ListEventsResponse wrapper for the ListEvents operation
4054
type ListEventsResponse struct {
4155

@@ -58,3 +72,8 @@ type ListEventsResponse struct {
5872
func (response ListEventsResponse) String() string {
5973
return common.PointerString(response)
6074
}
75+
76+
// HTTPResponse implements the OCIResponse interface
77+
func (response ListEventsResponse) HTTPResponse() *http.Response {
78+
return response.RawResponse
79+
}

audit/update_configuration_request_response.go

+19
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,26 @@ type UpdateConfigurationRequest struct {
1616

1717
// The configuration properties
1818
UpdateConfigurationDetails `contributesTo:"body"`
19+
20+
// Metadata about the request. This information will not be transmitted to the service, but
21+
// represents information that the SDK will consume to drive retry behavior.
22+
RequestMetadata common.RequestMetadata
1923
}
2024

2125
func (request UpdateConfigurationRequest) String() string {
2226
return common.PointerString(request)
2327
}
2428

29+
// HTTPRequest implements the OCIRequest interface
30+
func (request UpdateConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) {
31+
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
32+
}
33+
34+
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
35+
func (request UpdateConfigurationRequest) RetryPolicy() *common.RetryPolicy {
36+
return request.RequestMetadata.RetryPolicy
37+
}
38+
2539
// UpdateConfigurationResponse wrapper for the UpdateConfiguration operation
2640
type UpdateConfigurationResponse struct {
2741

@@ -39,3 +53,8 @@ type UpdateConfigurationResponse struct {
3953
func (response UpdateConfigurationResponse) String() string {
4054
return common.PointerString(response)
4155
}
56+
57+
// HTTPResponse implements the OCIResponse interface
58+
func (response UpdateConfigurationResponse) HTTPResponse() *http.Response {
59+
return response.RawResponse
60+
}

cmd/genver/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func main() {
4242
Tag string
4343
}{
4444
getEnvOrDefault(majorVer, "0"),
45-
getEnvOrDefault(minorVer, "0" ),
45+
getEnvOrDefault(minorVer, "0"),
4646
getEnvOrDefault(patchVer, "0"),
4747
getEnvOrDefault(tag, ""),
4848
}

cmd/genver/version_template.go

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

common/auth/instance_principal_key_provider.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ func (p *instancePrincipalKeyProvider) KeyID() (string, error) {
9595
return fmt.Sprintf("ST$%s", securityToken), nil
9696
}
9797

98-
9998
func (p *instancePrincipalKeyProvider) TenancyOCID() (string, error) {
10099
return p.tenancyID, nil
101-
}
100+
}

0 commit comments

Comments
 (0)