diff --git a/CHANGELOG.md b/CHANGELOG.md index e9d0ac890d..d360c0089c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.69.1 - 2024-07-09 +### Added +- Support for cost management of shared resources in the Usage service +- Support for creating new databases with oracle key vault on Exadata Cloud at Customer in the Database service +- Support for confirming key store details on Exadata Cloud at Customer in the Database service + + ## 65.69.0 - 2024-07-02 ### Added - Support for calling Oracle Cloud Infrastructure services in the `ap-singapore-2` region diff --git a/common/version.go b/common/version.go index c8849f7ff6..fb230b5125 100644 --- a/common/version.go +++ b/common/version.go @@ -13,7 +13,7 @@ import ( const ( major = "65" minor = "69" - patch = "0" + patch = "1" tag = "" ) diff --git a/database/confirm_key_store_details_are_correct_request_response.go b/database/confirm_key_store_details_are_correct_request_response.go new file mode 100644 index 0000000000..5817314051 --- /dev/null +++ b/database/confirm_key_store_details_are_correct_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ConfirmKeyStoreDetailsAreCorrectRequest wrapper for the ConfirmKeyStoreDetailsAreCorrect operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ConfirmKeyStoreDetailsAreCorrect.go.html to see an example of how to use ConfirmKeyStoreDetailsAreCorrectRequest. +type ConfirmKeyStoreDetailsAreCorrectRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the key store. + KeyStoreId *string `mandatory:"true" contributesTo:"path" name:"keyStoreId"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ConfirmKeyStoreDetailsAreCorrectRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ConfirmKeyStoreDetailsAreCorrectRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ConfirmKeyStoreDetailsAreCorrectRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ConfirmKeyStoreDetailsAreCorrectRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ConfirmKeyStoreDetailsAreCorrectRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ConfirmKeyStoreDetailsAreCorrectResponse wrapper for the ConfirmKeyStoreDetailsAreCorrect operation +type ConfirmKeyStoreDetailsAreCorrectResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ConfirmKeyStoreDetailsAreCorrectResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ConfirmKeyStoreDetailsAreCorrectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/create_database_details.go b/database/create_database_details.go index 72d4d8e46a..199687fa6a 100644 --- a/database/create_database_details.go +++ b/database/create_database_details.go @@ -72,6 +72,9 @@ type CreateDatabaseDetails struct { // Specifies a prefix for the `Oracle SID` of the database to be created. SidPrefix *string `mandatory:"false" json:"sidPrefix"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. + KeyStoreId *string `mandatory:"false" json:"keyStoreId"` } func (m CreateDatabaseDetails) String() string { diff --git a/database/database_client.go b/database/database_client.go index 69e04212cc..0bc800c911 100644 --- a/database/database_client.go +++ b/database/database_client.go @@ -2217,6 +2217,69 @@ func (client DatabaseClient) configureSaasAdminUser(ctx context.Context, request return response, err } +// ConfirmKeyStoreDetailsAreCorrect This is for user to confirm to DBaaS that the Oracle Key Valut (OKV) connection IPs, username and password are all correct. This operation will put +// the Key Store back into Active state. If details are incorrect, your OKV account may get locked after some unsuccessful attempts to connect. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ConfirmKeyStoreDetailsAreCorrect.go.html to see an example of how to use ConfirmKeyStoreDetailsAreCorrect API. +func (client DatabaseClient) ConfirmKeyStoreDetailsAreCorrect(ctx context.Context, request ConfirmKeyStoreDetailsAreCorrectRequest) (response ConfirmKeyStoreDetailsAreCorrectResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.confirmKeyStoreDetailsAreCorrect, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ConfirmKeyStoreDetailsAreCorrectResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ConfirmKeyStoreDetailsAreCorrectResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ConfirmKeyStoreDetailsAreCorrectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ConfirmKeyStoreDetailsAreCorrectResponse") + } + return +} + +// confirmKeyStoreDetailsAreCorrect implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) confirmKeyStoreDetailsAreCorrect(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/keyStores/{keyStoreId}/actions/confirmDetailsAreCorrect", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ConfirmKeyStoreDetailsAreCorrectResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/KeyStore/ConfirmKeyStoreDetailsAreCorrect" + err = common.PostProcessServiceError(err, "Database", "ConfirmKeyStoreDetailsAreCorrect", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ConvertToPdb Converts a non-container database to a pluggable database. // // # See also diff --git a/database/key_store.go b/database/key_store.go index 3e3d1382e2..391e30e3e2 100644 --- a/database/key_store.go +++ b/database/key_store.go @@ -127,18 +127,21 @@ type KeyStoreLifecycleStateEnum string // Set of constants representing the allowable values for KeyStoreLifecycleStateEnum const ( - KeyStoreLifecycleStateActive KeyStoreLifecycleStateEnum = "ACTIVE" - KeyStoreLifecycleStateDeleted KeyStoreLifecycleStateEnum = "DELETED" + KeyStoreLifecycleStateActive KeyStoreLifecycleStateEnum = "ACTIVE" + KeyStoreLifecycleStateDeleted KeyStoreLifecycleStateEnum = "DELETED" + KeyStoreLifecycleStateNeedsAttention KeyStoreLifecycleStateEnum = "NEEDS_ATTENTION" ) var mappingKeyStoreLifecycleStateEnum = map[string]KeyStoreLifecycleStateEnum{ - "ACTIVE": KeyStoreLifecycleStateActive, - "DELETED": KeyStoreLifecycleStateDeleted, + "ACTIVE": KeyStoreLifecycleStateActive, + "DELETED": KeyStoreLifecycleStateDeleted, + "NEEDS_ATTENTION": KeyStoreLifecycleStateNeedsAttention, } var mappingKeyStoreLifecycleStateEnumLowerCase = map[string]KeyStoreLifecycleStateEnum{ - "active": KeyStoreLifecycleStateActive, - "deleted": KeyStoreLifecycleStateDeleted, + "active": KeyStoreLifecycleStateActive, + "deleted": KeyStoreLifecycleStateDeleted, + "needs_attention": KeyStoreLifecycleStateNeedsAttention, } // GetKeyStoreLifecycleStateEnumValues Enumerates the set of values for KeyStoreLifecycleStateEnum @@ -155,6 +158,7 @@ func GetKeyStoreLifecycleStateEnumStringValues() []string { return []string{ "ACTIVE", "DELETED", + "NEEDS_ATTENTION", } } diff --git a/database/key_store_summary.go b/database/key_store_summary.go index cce838f4d1..15d66b34d6 100644 --- a/database/key_store_summary.go +++ b/database/key_store_summary.go @@ -127,18 +127,21 @@ type KeyStoreSummaryLifecycleStateEnum string // Set of constants representing the allowable values for KeyStoreSummaryLifecycleStateEnum const ( - KeyStoreSummaryLifecycleStateActive KeyStoreSummaryLifecycleStateEnum = "ACTIVE" - KeyStoreSummaryLifecycleStateDeleted KeyStoreSummaryLifecycleStateEnum = "DELETED" + KeyStoreSummaryLifecycleStateActive KeyStoreSummaryLifecycleStateEnum = "ACTIVE" + KeyStoreSummaryLifecycleStateDeleted KeyStoreSummaryLifecycleStateEnum = "DELETED" + KeyStoreSummaryLifecycleStateNeedsAttention KeyStoreSummaryLifecycleStateEnum = "NEEDS_ATTENTION" ) var mappingKeyStoreSummaryLifecycleStateEnum = map[string]KeyStoreSummaryLifecycleStateEnum{ - "ACTIVE": KeyStoreSummaryLifecycleStateActive, - "DELETED": KeyStoreSummaryLifecycleStateDeleted, + "ACTIVE": KeyStoreSummaryLifecycleStateActive, + "DELETED": KeyStoreSummaryLifecycleStateDeleted, + "NEEDS_ATTENTION": KeyStoreSummaryLifecycleStateNeedsAttention, } var mappingKeyStoreSummaryLifecycleStateEnumLowerCase = map[string]KeyStoreSummaryLifecycleStateEnum{ - "active": KeyStoreSummaryLifecycleStateActive, - "deleted": KeyStoreSummaryLifecycleStateDeleted, + "active": KeyStoreSummaryLifecycleStateActive, + "deleted": KeyStoreSummaryLifecycleStateDeleted, + "needs_attention": KeyStoreSummaryLifecycleStateNeedsAttention, } // GetKeyStoreSummaryLifecycleStateEnumValues Enumerates the set of values for KeyStoreSummaryLifecycleStateEnum @@ -155,6 +158,7 @@ func GetKeyStoreSummaryLifecycleStateEnumStringValues() []string { return []string{ "ACTIVE", "DELETED", + "NEEDS_ATTENTION", } } diff --git a/usageapi/usage_summary.go b/usageapi/usage_summary.go index e33ed8b26e..7bdbc99cde 100644 --- a/usageapi/usage_summary.go +++ b/usageapi/usage_summary.go @@ -84,6 +84,12 @@ type UsageSummary struct { // The usage number. ComputedQuantity *float32 `mandatory:"false" json:"computedQuantity"` + // The attributed cost with a max value of 9999999999.999999999999 and a minimum value of 0. + AttributedCost *string `mandatory:"false" json:"attributedCost"` + + // The attributed usage with a max value of 9999999999.999999999999 and a minimum value of 0. + AttributedUsage *string `mandatory:"false" json:"attributedUsage"` + // The SPM OverageFlag. OveragesFlag *string `mandatory:"false" json:"overagesFlag"`