diff --git a/CHANGELOG.md b/CHANGELOG.md index 760e85892e..2f1e7a5d88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,33 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.54.0 - 2023-12-04 +### Added +- Support for calling Oracle Cloud Infrastructure services in the eu-dcc-zurich-1 and the sa-bogota-1 region +- Support for managing certificates of target Servers in the Golden Gate service +- Support for AWR Hub Snapshot ingest endpoints in the Operations Insights service +- Support for reducing false positives in the Application Dependency Management service +- Support for ARM shapes in the Data Science service +- Support for new optional parameters in the upload discovery data API in the Usage service +- Support for multiple clusters in a Software-Defined Data Centers (SDDCs) in the VMWare Solution service +- Support for No/Zero days backup in Autonomous Container Database in the Database service +- Support for provisioning a VM Cluster with a choice of Exadata image version in the Database service +- Support for updating ocpu/ecpu count, local storage, ACD count and Exadata storage on Cloud Autonomous VM Cluster and Autonomous VM Cluster in the Database service +- Support for serial console history in the Database service +- Support for Oracle Linux 8 version database system in the Database service + +### Breaking +- Parameters `SddcId`, `CurrentSku`, `NextSku`, were renamed to `ClusterId`, `CurrentCommitment`, `NextCommitment` in models `CreateEsxiHostDetails`, `EsxiHost` and `EsxiHostSummary` in the VMWare Solution service +- Parameter `FailedEsxiHostId` was removed from `CreateEsxiHostDetails` model in the VMWare Solution service +- Parameter `NonUpgradedEsxiHostId` was renamed to `EsxiSoftwareVersion` in `CreateEsxiHostDetails` model in the VMWare Solution service +- Parameter `EsxiHostsCount` was removed from `CreateEsxiHostDetails` model in the VMWare Solution service +- Parameters `ProvisioningSubnetId`, `VsphereVlanId`, `VmotionVlanId`, `VsanVlanId`, `NsxVTepVlanId`, `NsxEdgeVTepVlanId`, `NsxEdgeUplink1VlanId`, `NsxEdgeUplink2VlanId`, `InstanceDisplayNamePrefix`, `InitialSku`, `IsHcxEnabled`, `HcxVlanId`, `IsHcxEnterpriseEnabled` were removed from `CreateSddcDetails` model in the VMWare Solution service +- Parameters `VsphereVlanId`, `VmotionVlanId`, `VsanVlanId`, `NsxVTepVlanId`, `NsxEdgeVTepVlanId`, `NsxEdgeUplink1VlanId`, `NsxEdgeUplink2VlanId`, `ReplicationVlanId`, `ProvisioningVlanId`, `HcxVlanId` were removed from `UpdateSddcDetails` model in the VMWare Solution service +- Parameters `SupportedSddcTypes` and `IsSupportMonthlySku` were removed from `SupportedHostShapeSummary` model in the VMWare Solution service +- Parameter `ComputeAvailabilityDomain` was removed from `Sddc` and `SddcSummary` models in the VMWare Solution service +- Parameter `SddcType` was removed from `ListSupportedHostShapesRequest` model in the VMWare Solution service + + ## 65.53.0 - 2023-11-14 ### Added - Support for the PostgreSQL service diff --git a/adm/adm_applicationdependencymanagement_client.go b/adm/adm_applicationdependencymanagement_client.go index f95b9192a6..d18e02ae92 100644 --- a/adm/adm_applicationdependencymanagement_client.go +++ b/adm/adm_applicationdependencymanagement_client.go @@ -1461,7 +1461,7 @@ func (client ApplicationDependencyManagementClient) listApplicationDependencyRec defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/adm/20220421/ApplicationDependencyRecommendationCollection/ListApplicationDependencyRecommendations" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/adm/20220421/RemediationRun/ListApplicationDependencyRecommendations" err = common.PostProcessServiceError(err, "ApplicationDependencyManagement", "ListApplicationDependencyRecommendations", apiReferenceLink) return response, err } @@ -1637,7 +1637,7 @@ func (client ApplicationDependencyManagementClient) listRemediationRecipes(ctx c defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/adm/20220421/RemediationRecipeCollection/ListRemediationRecipes" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/adm/20220421/RemediationRecipe/ListRemediationRecipes" err = common.PostProcessServiceError(err, "ApplicationDependencyManagement", "ListRemediationRecipes", apiReferenceLink) return response, err } @@ -1696,7 +1696,7 @@ func (client ApplicationDependencyManagementClient) listRemediationRuns(ctx cont defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/adm/20220421/RemediationRunCollection/ListRemediationRuns" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/adm/20220421/RemediationRun/ListRemediationRuns" err = common.PostProcessServiceError(err, "ApplicationDependencyManagement", "ListRemediationRuns", apiReferenceLink) return response, err } @@ -1754,7 +1754,7 @@ func (client ApplicationDependencyManagementClient) listStages(ctx context.Conte defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/adm/20220421/RemediationRunStageCollection/ListStages" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/adm/20220421/RemediationRunStage/ListStages" err = common.PostProcessServiceError(err, "ApplicationDependencyManagement", "ListStages", apiReferenceLink) return response, err } @@ -1764,7 +1764,7 @@ func (client ApplicationDependencyManagementClient) listStages(ctx context.Conte } // ListVulnerabilityAudits Returns a list of Vulnerability Audits based on the specified query parameters. -// At least one of id, compartmentId or knowledgeBaseId query parameter must be provided. +// At least one of id, compartmentId query parameter must be provided. // // # See also // diff --git a/adm/create_vulnerability_audit_details.go b/adm/create_vulnerability_audit_details.go index 72b0314e25..47a31ad315 100644 --- a/adm/create_vulnerability_audit_details.go +++ b/adm/create_vulnerability_audit_details.go @@ -34,6 +34,8 @@ type CreateVulnerabilityAuditDetails struct { Configuration *VulnerabilityAuditConfiguration `mandatory:"false" json:"configuration"` + UsageData UsageDataDetails `mandatory:"false" json:"usageData"` + // The name of the vulnerability audit. DisplayName *string `mandatory:"false" json:"displayName"` @@ -73,6 +75,7 @@ func (m *CreateVulnerabilityAuditDetails) UnmarshalJSON(data []byte) (e error) { CompartmentId *string `json:"compartmentId"` ApplicationDependencies []ApplicationDependency `json:"applicationDependencies"` Configuration *VulnerabilityAuditConfiguration `json:"configuration"` + UsageData usagedatadetails `json:"usageData"` DisplayName *string `json:"displayName"` Source vulnerabilityauditsource `json:"source"` FreeformTags map[string]string `json:"freeformTags"` @@ -92,6 +95,16 @@ func (m *CreateVulnerabilityAuditDetails) UnmarshalJSON(data []byte) (e error) { copy(m.ApplicationDependencies, model.ApplicationDependencies) m.Configuration = model.Configuration + nn, e = model.UsageData.UnmarshalPolymorphicJSON(model.UsageData.JsonData) + if e != nil { + return + } + if nn != nil { + m.UsageData = nn.(UsageDataDetails) + } else { + m.UsageData = nil + } + m.DisplayName = model.DisplayName nn, e = model.Source.UnmarshalPolymorphicJSON(model.Source.JsonData) diff --git a/adm/usage_data_details.go b/adm/usage_data_details.go new file mode 100644 index 0000000000..79324208c0 --- /dev/null +++ b/adm/usage_data_details.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Application Dependency Management API +// +// Use the Application Dependency Management API to create knowledge bases and vulnerability audits. For more information, see ADM (https://docs.cloud.oracle.com/Content/application-dependency-management/home.htm). +// + +package adm + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UsageDataDetails The source details of the usage data on Object Storage. +// Set `sourceType` to `objectStorageTuple` +// and use UsageDataViaObjectStorageTupleDetails +// when specifying the namespace, bucket name, and object name. +type UsageDataDetails interface { +} + +type usagedatadetails struct { + JsonData []byte + SourceType string `json:"sourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *usagedatadetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerusagedatadetails usagedatadetails + s := struct { + Model Unmarshalerusagedatadetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.SourceType = s.Model.SourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *usagedatadetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SourceType { + case "objectStorageTuple": + mm := UsageDataViaObjectStorageTupleDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UsageDataDetails: %s.", m.SourceType) + return *m, nil + } +} + +func (m usagedatadetails) String() string { + return common.PointerString(m) +} + +// 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 (m usagedatadetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/adm/usage_data_via_object_storage_tuple_details.go b/adm/usage_data_via_object_storage_tuple_details.go new file mode 100644 index 0000000000..72add6d270 --- /dev/null +++ b/adm/usage_data_via_object_storage_tuple_details.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Application Dependency Management API +// +// Use the Application Dependency Management API to create knowledge bases and vulnerability audits. For more information, see ADM (https://docs.cloud.oracle.com/Content/application-dependency-management/home.htm). +// + +package adm + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UsageDataViaObjectStorageTupleDetails Reference to an object in Object Storage as a tuple. +type UsageDataViaObjectStorageTupleDetails struct { + + // The Object Storage bucket to read the usage data from. + BucketName *string `mandatory:"true" json:"bucketName"` + + // The Object Storage namespace to read the usage data from. + NamespaceName *string `mandatory:"true" json:"namespaceName"` + + // The Object Storage object name to read the usage data from. + ObjectName *string `mandatory:"true" json:"objectName"` +} + +func (m UsageDataViaObjectStorageTupleDetails) String() string { + return common.PointerString(m) +} + +// 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 (m UsageDataViaObjectStorageTupleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UsageDataViaObjectStorageTupleDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUsageDataViaObjectStorageTupleDetails UsageDataViaObjectStorageTupleDetails + s := struct { + DiscriminatorParam string `json:"sourceType"` + MarshalTypeUsageDataViaObjectStorageTupleDetails + }{ + "objectStorageTuple", + (MarshalTypeUsageDataViaObjectStorageTupleDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/adm/vulnerability.go b/adm/vulnerability.go index 6456df6e3c..b570bd5d94 100644 --- a/adm/vulnerability.go +++ b/adm/vulnerability.go @@ -30,6 +30,9 @@ type Vulnerability struct { // Indicates if the vulnerability was ignored according to the audit configuration. IsIgnored *bool `mandatory:"true" json:"isIgnored"` + + // Indicates if the vulnerability is a false positive according to the usage data. If no usage data was provided or the service cannot infer usage of the vulnerable code then this property is `null`. + IsFalsePositive *bool `mandatory:"false" json:"isFalsePositive"` } func (m Vulnerability) String() string { diff --git a/adm/vulnerability_audit.go b/adm/vulnerability_audit.go index abdfdb49a9..8573c2c8a0 100644 --- a/adm/vulnerability_audit.go +++ b/adm/vulnerability_audit.go @@ -69,8 +69,13 @@ type VulnerabilityAudit struct { // The name of the vulnerability audit. DisplayName *string `mandatory:"false" json:"displayName"` + // Details on the lifecycle state. + LifecycleDetails VulnerabilityAuditLifecycleDetailsEnum `mandatory:"false" json:"lifecycleDetails,omitempty"` + Configuration *VulnerabilityAuditConfiguration `mandatory:"false" json:"configuration"` + UsageData UsageDataDetails `mandatory:"false" json:"usageData"` + // Indicates if an audit succeeded according to the configuration. The value is `null` if the audit is in the `CREATING` state. IsSuccess *bool `mandatory:"false" json:"isSuccess"` @@ -103,6 +108,9 @@ func (m VulnerabilityAudit) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BuildType: %s. Supported values are: %s.", m.BuildType, strings.Join(GetVulnerabilityAuditBuildTypeEnumStringValues(), ","))) } + if _, ok := GetMappingVulnerabilityAuditLifecycleDetailsEnum(string(m.LifecycleDetails)); !ok && m.LifecycleDetails != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleDetails: %s. Supported values are: %s.", m.LifecycleDetails, strings.Join(GetVulnerabilityAuditLifecycleDetailsEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -112,27 +120,29 @@ func (m VulnerabilityAudit) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *VulnerabilityAudit) UnmarshalJSON(data []byte) (e error) { model := struct { - DisplayName *string `json:"displayName"` - Configuration *VulnerabilityAuditConfiguration `json:"configuration"` - IsSuccess *bool `json:"isSuccess"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - SystemTags map[string]map[string]interface{} `json:"systemTags"` - Id *string `json:"id"` - KnowledgeBaseId *string `json:"knowledgeBaseId"` - TimeCreated *common.SDKTime `json:"timeCreated"` - TimeUpdated *common.SDKTime `json:"timeUpdated"` - LifecycleState VulnerabilityAuditLifecycleStateEnum `json:"lifecycleState"` - Vulnerabilities []Vulnerability `json:"vulnerabilities"` - MaxObservedCvssV2Score *float32 `json:"maxObservedCvssV2Score"` - MaxObservedCvssV3Score *float32 `json:"maxObservedCvssV3Score"` - MaxObservedCvssV2ScoreWithIgnored *float32 `json:"maxObservedCvssV2ScoreWithIgnored"` - MaxObservedCvssV3ScoreWithIgnored *float32 `json:"maxObservedCvssV3ScoreWithIgnored"` - VulnerableArtifactsCountWithIgnored *int `json:"vulnerableArtifactsCountWithIgnored"` - VulnerableArtifactsCount *int `json:"vulnerableArtifactsCount"` - BuildType VulnerabilityAuditBuildTypeEnum `json:"buildType"` - Source vulnerabilityauditsource `json:"source"` - CompartmentId *string `json:"compartmentId"` + DisplayName *string `json:"displayName"` + LifecycleDetails VulnerabilityAuditLifecycleDetailsEnum `json:"lifecycleDetails"` + Configuration *VulnerabilityAuditConfiguration `json:"configuration"` + UsageData usagedatadetails `json:"usageData"` + IsSuccess *bool `json:"isSuccess"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + Id *string `json:"id"` + KnowledgeBaseId *string `json:"knowledgeBaseId"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleState VulnerabilityAuditLifecycleStateEnum `json:"lifecycleState"` + Vulnerabilities []Vulnerability `json:"vulnerabilities"` + MaxObservedCvssV2Score *float32 `json:"maxObservedCvssV2Score"` + MaxObservedCvssV3Score *float32 `json:"maxObservedCvssV3Score"` + MaxObservedCvssV2ScoreWithIgnored *float32 `json:"maxObservedCvssV2ScoreWithIgnored"` + MaxObservedCvssV3ScoreWithIgnored *float32 `json:"maxObservedCvssV3ScoreWithIgnored"` + VulnerableArtifactsCountWithIgnored *int `json:"vulnerableArtifactsCountWithIgnored"` + VulnerableArtifactsCount *int `json:"vulnerableArtifactsCount"` + BuildType VulnerabilityAuditBuildTypeEnum `json:"buildType"` + Source vulnerabilityauditsource `json:"source"` + CompartmentId *string `json:"compartmentId"` }{} e = json.Unmarshal(data, &model) @@ -142,8 +152,20 @@ func (m *VulnerabilityAudit) UnmarshalJSON(data []byte) (e error) { var nn interface{} m.DisplayName = model.DisplayName + m.LifecycleDetails = model.LifecycleDetails + m.Configuration = model.Configuration + nn, e = model.UsageData.UnmarshalPolymorphicJSON(model.UsageData.JsonData) + if e != nil { + return + } + if nn != nil { + m.UsageData = nn.(UsageDataDetails) + } else { + m.UsageData = nil + } + m.IsSuccess = model.IsSuccess m.FreeformTags = model.FreeformTags @@ -247,6 +269,60 @@ func GetMappingVulnerabilityAuditLifecycleStateEnum(val string) (VulnerabilityAu return enum, ok } +// VulnerabilityAuditLifecycleDetailsEnum Enum with underlying type: string +type VulnerabilityAuditLifecycleDetailsEnum string + +// Set of constants representing the allowable values for VulnerabilityAuditLifecycleDetailsEnum +const ( + VulnerabilityAuditLifecycleDetailsNotFoundOrNotAuthorized VulnerabilityAuditLifecycleDetailsEnum = "USAGE_DATA_NOT_FOUND_OR_NOT_AUTHORIZED" + VulnerabilityAuditLifecycleDetailsParseFailed VulnerabilityAuditLifecycleDetailsEnum = "USAGE_DATA_PARSE_FAILED" + VulnerabilityAuditLifecycleDetailsCompressedSizeLimitExceeded VulnerabilityAuditLifecycleDetailsEnum = "USAGE_DATA_COMPRESSED_SIZE_LIMIT_EXCEEDED" + VulnerabilityAuditLifecycleDetailsUncompressedSizeLimitExceeded VulnerabilityAuditLifecycleDetailsEnum = "USAGE_DATA_UNCOMPRESSED_SIZE_LIMIT_EXCEEDED" + VulnerabilityAuditLifecycleDetailsUnknownError VulnerabilityAuditLifecycleDetailsEnum = "USAGE_DATA_UNKNOWN_ERROR" +) + +var mappingVulnerabilityAuditLifecycleDetailsEnum = map[string]VulnerabilityAuditLifecycleDetailsEnum{ + "USAGE_DATA_NOT_FOUND_OR_NOT_AUTHORIZED": VulnerabilityAuditLifecycleDetailsNotFoundOrNotAuthorized, + "USAGE_DATA_PARSE_FAILED": VulnerabilityAuditLifecycleDetailsParseFailed, + "USAGE_DATA_COMPRESSED_SIZE_LIMIT_EXCEEDED": VulnerabilityAuditLifecycleDetailsCompressedSizeLimitExceeded, + "USAGE_DATA_UNCOMPRESSED_SIZE_LIMIT_EXCEEDED": VulnerabilityAuditLifecycleDetailsUncompressedSizeLimitExceeded, + "USAGE_DATA_UNKNOWN_ERROR": VulnerabilityAuditLifecycleDetailsUnknownError, +} + +var mappingVulnerabilityAuditLifecycleDetailsEnumLowerCase = map[string]VulnerabilityAuditLifecycleDetailsEnum{ + "usage_data_not_found_or_not_authorized": VulnerabilityAuditLifecycleDetailsNotFoundOrNotAuthorized, + "usage_data_parse_failed": VulnerabilityAuditLifecycleDetailsParseFailed, + "usage_data_compressed_size_limit_exceeded": VulnerabilityAuditLifecycleDetailsCompressedSizeLimitExceeded, + "usage_data_uncompressed_size_limit_exceeded": VulnerabilityAuditLifecycleDetailsUncompressedSizeLimitExceeded, + "usage_data_unknown_error": VulnerabilityAuditLifecycleDetailsUnknownError, +} + +// GetVulnerabilityAuditLifecycleDetailsEnumValues Enumerates the set of values for VulnerabilityAuditLifecycleDetailsEnum +func GetVulnerabilityAuditLifecycleDetailsEnumValues() []VulnerabilityAuditLifecycleDetailsEnum { + values := make([]VulnerabilityAuditLifecycleDetailsEnum, 0) + for _, v := range mappingVulnerabilityAuditLifecycleDetailsEnum { + values = append(values, v) + } + return values +} + +// GetVulnerabilityAuditLifecycleDetailsEnumStringValues Enumerates the set of values in String for VulnerabilityAuditLifecycleDetailsEnum +func GetVulnerabilityAuditLifecycleDetailsEnumStringValues() []string { + return []string{ + "USAGE_DATA_NOT_FOUND_OR_NOT_AUTHORIZED", + "USAGE_DATA_PARSE_FAILED", + "USAGE_DATA_COMPRESSED_SIZE_LIMIT_EXCEEDED", + "USAGE_DATA_UNCOMPRESSED_SIZE_LIMIT_EXCEEDED", + "USAGE_DATA_UNKNOWN_ERROR", + } +} + +// GetMappingVulnerabilityAuditLifecycleDetailsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingVulnerabilityAuditLifecycleDetailsEnum(val string) (VulnerabilityAuditLifecycleDetailsEnum, bool) { + enum, ok := mappingVulnerabilityAuditLifecycleDetailsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + // VulnerabilityAuditBuildTypeEnum Enum with underlying type: string type VulnerabilityAuditBuildTypeEnum string diff --git a/adm/work_request_summary.go b/adm/work_request_summary.go index a4b30114cf..4b3107af5e 100644 --- a/adm/work_request_summary.go +++ b/adm/work_request_summary.go @@ -57,6 +57,10 @@ type WorkRequestSummary struct { // The date and time the object was finished, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339). TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m WorkRequestSummary) String() string { diff --git a/common/auth/resouce_principal_delegation_token_provider.go b/common/auth/resource_principal_delegation_token_provider.go similarity index 100% rename from common/auth/resouce_principal_delegation_token_provider.go rename to common/auth/resource_principal_delegation_token_provider.go diff --git a/common/auth/resouce_principal_delegation_token_provider_test.go b/common/auth/resource_principal_delegation_token_provider_test.go similarity index 100% rename from common/auth/resouce_principal_delegation_token_provider_test.go rename to common/auth/resource_principal_delegation_token_provider_test.go diff --git a/common/auth/resouce_principal_key_provider.go b/common/auth/resource_principal_key_provider.go similarity index 100% rename from common/auth/resouce_principal_key_provider.go rename to common/auth/resource_principal_key_provider.go diff --git a/common/auth/resouce_principal_key_provider_test.go b/common/auth/resource_principal_key_provider_test.go similarity index 100% rename from common/auth/resouce_principal_key_provider_test.go rename to common/auth/resource_principal_key_provider_test.go diff --git a/common/client.go b/common/client.go index 524b4d07ed..9ea94cba7d 100644 --- a/common/client.go +++ b/common/client.go @@ -549,7 +549,7 @@ func (rsc *OCIReadSeekCloser) Seek(offset int64, whence int) (int64, error) { return rsc.rc.(io.Seeker).Seek(offset, whence) } // once the binary request body is wrapped with ioutil.NopCloser: - if rsc.isNopCloser() { + if isNopCloser(rsc.rc) { unwrappedInterface := reflect.ValueOf(rsc.rc).Field(0).Interface() if _, ok := unwrappedInterface.(io.Seeker); ok { return unwrappedInterface.(io.Seeker).Seek(offset, whence) @@ -587,7 +587,7 @@ func (rsc *OCIReadSeekCloser) Seekable() bool { return true } // once the binary request body is wrapped with ioutil.NopCloser: - if rsc.isNopCloser() { + if isNopCloser(rsc.rc) { if _, ok := reflect.ValueOf(rsc.rc).Field(0).Interface().(io.Seeker); ok { return true } @@ -595,14 +595,6 @@ func (rsc *OCIReadSeekCloser) Seekable() bool { return false } -// Helper function to judge if this struct is a nopCloser or nopCloserWriterTo -func (rsc *OCIReadSeekCloser) isNopCloser() bool { - if reflect.TypeOf(rsc.rc) == reflect.TypeOf(ioutil.NopCloser(nil)) || reflect.TypeOf(rsc.rc) == reflect.TypeOf(ioutil.NopCloser(bytes.NewReader(nil))) { - return true - } - return false -} - // OCIResponse is the response from issuing a request to an OCI service. type OCIResponse interface { // HTTPResponse returns the raw HTTP response. diff --git a/common/http.go b/common/http.go index 80d75c4d65..2a9a1ff0d0 100644 --- a/common/http.go +++ b/common/http.go @@ -296,7 +296,7 @@ func addToBody(request *http.Request, value reflect.Value, field reflect.StructF } func checkBinaryBodyLength(request *http.Request) (contentLen int64, err error) { - if reflect.TypeOf(request.Body) == reflect.TypeOf(ioutil.NopCloser(nil)) { + if isNopCloser(request.Body) { ioReader := reflect.ValueOf(request.Body).Field(0).Interface().(io.Reader) switch t := ioReader.(type) { case *bytes.Reader: @@ -319,7 +319,32 @@ func checkBinaryBodyLength(request *http.Request) (contentLen int64, err error) return getNormalBinaryBodyLength(request) } +// Helper function to judge if this struct is a nopCloser or nopCloserWriterTo +func isNopCloser(readCloser io.ReadCloser) bool { + if reflect.TypeOf(readCloser) == reflect.TypeOf(io.NopCloser(nil)) || reflect.TypeOf(readCloser) == reflect.TypeOf(io.NopCloser(struct { + io.Reader + io.WriterTo + }{})) { + return true + } + return false +} + func getNormalBinaryBodyLength(request *http.Request) (contentLen int64, err error) { + // If binary body is seekable + seeker := getSeeker(request.Body) + if seeker != nil { + // save the current position, calculate the unread body length and seek it back to current position + if curPos, err := seeker.Seek(0, io.SeekCurrent); err == nil { + if endPos, err := seeker.Seek(0, io.SeekEnd); err == nil { + contentLen = endPos - curPos + if _, err = seeker.Seek(curPos, io.SeekStart); err == nil { + return contentLen, nil + } + } + } + } + var dumpRequestBody io.ReadCloser if dumpRequestBody, request.Body, err = drainBody(request.Body); err != nil { return contentLen, err @@ -331,6 +356,19 @@ func getNormalBinaryBodyLength(request *http.Request) (contentLen int64, err err return int64(len(contentBody)), nil } +func getSeeker(readCloser io.ReadCloser) (seeker io.Seeker) { + if seeker, ok := readCloser.(io.Seeker); ok { + return seeker + } + // the binary body is wrapped with io.NopCloser + if isNopCloser(readCloser) { + if seeker, ok := reflect.ValueOf(readCloser).Field(0).Interface().(io.Seeker); ok { + return seeker + } + } + return seeker +} + func addToQuery(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { Debugln("Marshaling to query from field: ", field.Name) if request.URL == nil { diff --git a/common/http_test.go b/common/http_test.go index a9d978182b..60c0496837 100644 --- a/common/http_test.go +++ b/common/http_test.go @@ -757,6 +757,79 @@ func TestMarshalBinaryRequestWithoutContentLengthSetting(t *testing.T) { assert.Equal(t, data, string(all)) } +func TestContentLength_NOPCloser_BytesReader(t *testing.T) { + data := []byte("wrapping bytes Reader in NOP Closer") + r := reqWithBinaryFiledButNoContentLengthField{Content: io.NopCloser(bytes.NewReader(data))} + httpRequest, err := MakeDefaultHTTPRequestWithTaggedStruct("PUT", "/obj", r) + assert.NoError(t, err) + assert.Equal(t, int64(35), httpRequest.ContentLength) +} + +func TestContentLength_NOPCloser_BytesBuffer(t *testing.T) { + data := "wrapping bytes buffer in NOP Closer" + buffer := bytes.NewBufferString(data) + r := reqWithBinaryFiledButNoContentLengthField{Content: io.NopCloser(buffer)} + httpRequest, err := MakeDefaultHTTPRequestWithTaggedStruct("PUT", "/obj", r) + assert.NoError(t, err) + assert.Equal(t, int64(35), httpRequest.ContentLength) +} + +func TestContentLength_NopCloser_StringReader(t *testing.T) { + testString := "wrapping strings Reader in NOP Closer" + r := reqWithBinaryFiledButNoContentLengthField{Content: io.NopCloser(strings.NewReader(testString))} + httpRequest, err := MakeDefaultHTTPRequestWithTaggedStruct("PUT", "/obj", r) + assert.NoError(t, err) + assert.Equal(t, int64(37), httpRequest.ContentLength) +} + +func TestContentLength_StringsReader_Seeker(t *testing.T) { + testString := "Get ContentLength for Strings Reader" + r := reqWithBinaryFiledButNoContentLengthField{Content: io.NopCloser(strings.NewReader(testString))} + httpRequest, err := MakeDefaultHTTPRequestWithTaggedStruct("PUT", "/obj", r) + assert.NoError(t, err) + contentLen, err := getNormalBinaryBodyLength(&httpRequest) + assert.NoError(t, err) + assert.Equal(t, int64(36), contentLen) + seeker := getSeeker(httpRequest.Body) + // Seek to the 6th byte position from the end and calculate the content length + seeker.Seek(-6, io.SeekEnd) + contentLen, err = getNormalBinaryBodyLength(&httpRequest) + assert.NoError(t, err) + assert.Equal(t, int64(6), contentLen) + // Read the complete body from the current position till the end + contentBody, err := io.ReadAll(httpRequest.Body) + assert.NoError(t, err) + assert.Equal(t, []byte("Reader"), contentBody) + // Calculate the content length + contentLen, err = getNormalBinaryBodyLength(&httpRequest) + assert.NoError(t, err) + assert.Equal(t, int64(0), contentLen) +} + +func TestContentLength_BytesReader_Seeker(t *testing.T) { + data := []byte("Get ContentLength for Bytes Reader") + r := reqWithBinaryFiledButNoContentLengthField{Content: io.NopCloser(bytes.NewReader(data))} + httpRequest, err := MakeDefaultHTTPRequestWithTaggedStruct("PUT", "/obj", r) + assert.NoError(t, err) + contentLen, err := getNormalBinaryBodyLength(&httpRequest) + assert.NoError(t, err) + assert.Equal(t, int64(34), contentLen) + seeker := getSeeker(httpRequest.Body) + // Seek to the 12th byte position from the end and calculate the content length + seeker.Seek(-12, io.SeekEnd) + contentLen, err = getNormalBinaryBodyLength(&httpRequest) + assert.NoError(t, err) + assert.Equal(t, int64(12), contentLen) + // Read the complete body from the current position till the end + contentBody, err := io.ReadAll(httpRequest.Body) + assert.NoError(t, err) + assert.Equal(t, []byte("Bytes Reader"), contentBody) + // Calculate the content length + contentLen, err = getNormalBinaryBodyLength(&httpRequest) + assert.NoError(t, err) + assert.Equal(t, int64(0), contentLen) +} + func TestMarshalBinaryRequestNonMandatoryBody(t *testing.T) { signer := ociRequestSigner{KeyProvider: testKeyProvider{}, ShouldHashBody: defaultBodyHashPredicate, diff --git a/common/regions.go b/common/regions.go index 995f5a3321..d2d67d504d 100644 --- a/common/regions.go +++ b/common/regions.go @@ -76,6 +76,8 @@ const ( RegionMXMonterrey1 Region = "mx-monterrey-1" //RegionUSSaltlake2 region Saltlake RegionUSSaltlake2 Region = "us-saltlake-2" + //RegionSABogota1 region Bogota + RegionSABogota1 Region = "sa-bogota-1" //RegionUSLangley1 region Langley RegionUSLangley1 Region = "us-langley-1" //RegionUSLuke1 region Luke @@ -116,6 +118,8 @@ const ( RegionEUFrankfurt2 Region = "eu-frankfurt-2" //RegionEUJovanovac1 region Jovanovac RegionEUJovanovac1 Region = "eu-jovanovac-1" + //RegionEUDccZurich1 region Zurich + RegionEUDccZurich1 Region = "eu-dcc-zurich-1" ) var shortNameRegion = map[string]Region{ @@ -155,6 +159,7 @@ var shortNameRegion = map[string]Region{ "ord": RegionUSChicago1, "mty": RegionMXMonterrey1, "aga": RegionUSSaltlake2, + "bog": RegionSABogota1, "lfi": RegionUSLangley1, "luf": RegionUSLuke1, "ric": RegionUSGovAshburn1, @@ -175,6 +180,7 @@ var shortNameRegion = map[string]Region{ "vll": RegionEUMadrid2, "str": RegionEUFrankfurt2, "beg": RegionEUJovanovac1, + "avz": RegionEUDccZurich1, } var realm = map[string]string{ @@ -188,6 +194,7 @@ var realm = map[string]string{ "oc14": "oraclecloud14.com", "oc19": "oraclecloud.eu", "oc20": "oraclecloud20.com", + "oc24": "oraclecloud24.com", } var regionRealm = map[Region]string{ @@ -227,6 +234,7 @@ var regionRealm = map[Region]string{ RegionUSChicago1: "oc1", RegionMXMonterrey1: "oc1", RegionUSSaltlake2: "oc1", + RegionSABogota1: "oc1", RegionUSLangley1: "oc2", RegionUSLuke1: "oc2", @@ -256,4 +264,6 @@ var regionRealm = map[Region]string{ RegionEUFrankfurt2: "oc19", RegionEUJovanovac1: "oc20", + + RegionEUDccZurich1: "oc24", } diff --git a/common/regions.json b/common/regions.json index c877744090..5e08ab67f3 100644 --- a/common/regions.json +++ b/common/regions.json @@ -334,5 +334,17 @@ "realmKey": "oc1", "regionIdentifier": "us-saltlake-2", "realmDomainComponent": "oraclecloud.com" + }, + { + "regionKey": "avz", + "realmKey": "oc24", + "regionIdentifier": "eu-dcc-zurich-1", + "realmDomainComponent": "oraclecloud24.com" + }, + { + "regionKey": "bog", + "realmKey": "oc1", + "regionIdentifier": "sa-bogota-1", + "realmDomainComponent": "oraclecloud.com" } ] \ No newline at end of file diff --git a/common/version.go b/common/version.go index 967e15fb13..507687e6ee 100644 --- a/common/version.go +++ b/common/version.go @@ -12,7 +12,7 @@ import ( const ( major = "65" - minor = "53" + minor = "54" patch = "0" tag = "" ) diff --git a/computecloudatcustomer/ccc_infrastructure.go b/computecloudatcustomer/ccc_infrastructure.go index 4a42e96196..830c1dc05e 100644 --- a/computecloudatcustomer/ccc_infrastructure.go +++ b/computecloudatcustomer/ccc_infrastructure.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_infrastructure_collection.go b/computecloudatcustomer/ccc_infrastructure_collection.go index a22f239e88..a4cc138956 100644 --- a/computecloudatcustomer/ccc_infrastructure_collection.go +++ b/computecloudatcustomer/ccc_infrastructure_collection.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_infrastructure_inventory.go b/computecloudatcustomer/ccc_infrastructure_inventory.go index b4a62f03f0..24a157a50b 100644 --- a/computecloudatcustomer/ccc_infrastructure_inventory.go +++ b/computecloudatcustomer/ccc_infrastructure_inventory.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_infrastructure_management_node.go b/computecloudatcustomer/ccc_infrastructure_management_node.go index 5ce6f1049e..ce1c98ddda 100644 --- a/computecloudatcustomer/ccc_infrastructure_management_node.go +++ b/computecloudatcustomer/ccc_infrastructure_management_node.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_infrastructure_network_configuration.go b/computecloudatcustomer/ccc_infrastructure_network_configuration.go index 76bc159899..b3dbf3d925 100644 --- a/computecloudatcustomer/ccc_infrastructure_network_configuration.go +++ b/computecloudatcustomer/ccc_infrastructure_network_configuration.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_infrastructure_routing_dynamic_details.go b/computecloudatcustomer/ccc_infrastructure_routing_dynamic_details.go index f7eec920d4..7dd232f04d 100644 --- a/computecloudatcustomer/ccc_infrastructure_routing_dynamic_details.go +++ b/computecloudatcustomer/ccc_infrastructure_routing_dynamic_details.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_infrastructure_routing_static_details.go b/computecloudatcustomer/ccc_infrastructure_routing_static_details.go index f1fee10e18..d5dafdef84 100644 --- a/computecloudatcustomer/ccc_infrastructure_routing_static_details.go +++ b/computecloudatcustomer/ccc_infrastructure_routing_static_details.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_infrastructure_summary.go b/computecloudatcustomer/ccc_infrastructure_summary.go index 3f4038f806..9891a6a4d1 100644 --- a/computecloudatcustomer/ccc_infrastructure_summary.go +++ b/computecloudatcustomer/ccc_infrastructure_summary.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_schedule_event.go b/computecloudatcustomer/ccc_schedule_event.go index bc5ed99fd3..530200f8a4 100644 --- a/computecloudatcustomer/ccc_schedule_event.go +++ b/computecloudatcustomer/ccc_schedule_event.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_upgrade_information.go b/computecloudatcustomer/ccc_upgrade_information.go index 4d46ef32cf..e09f8c112c 100644 --- a/computecloudatcustomer/ccc_upgrade_information.go +++ b/computecloudatcustomer/ccc_upgrade_information.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_upgrade_schedule.go b/computecloudatcustomer/ccc_upgrade_schedule.go index ac0cf0f063..cb3f6765f8 100644 --- a/computecloudatcustomer/ccc_upgrade_schedule.go +++ b/computecloudatcustomer/ccc_upgrade_schedule.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_upgrade_schedule_collection.go b/computecloudatcustomer/ccc_upgrade_schedule_collection.go index 6ff19c89b5..fe04ae3684 100644 --- a/computecloudatcustomer/ccc_upgrade_schedule_collection.go +++ b/computecloudatcustomer/ccc_upgrade_schedule_collection.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/ccc_upgrade_schedule_summary.go b/computecloudatcustomer/ccc_upgrade_schedule_summary.go index ce0299e48c..c02d85fd86 100644 --- a/computecloudatcustomer/ccc_upgrade_schedule_summary.go +++ b/computecloudatcustomer/ccc_upgrade_schedule_summary.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/change_ccc_infrastructure_compartment_details.go b/computecloudatcustomer/change_ccc_infrastructure_compartment_details.go index 93722370d2..fcd800dc01 100644 --- a/computecloudatcustomer/change_ccc_infrastructure_compartment_details.go +++ b/computecloudatcustomer/change_ccc_infrastructure_compartment_details.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_details.go b/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_details.go index d17ff1aa7e..88b31f2212 100644 --- a/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_details.go +++ b/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_details.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/computecloudatcustomer_client.go b/computecloudatcustomer/computecloudatcustomer_client.go index 3479379fb6..1769ab4867 100644 --- a/computecloudatcustomer/computecloudatcustomer_client.go +++ b/computecloudatcustomer/computecloudatcustomer_client.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/create_ccc_infrastructure_details.go b/computecloudatcustomer/create_ccc_infrastructure_details.go index 404d58726c..0dd610c322 100644 --- a/computecloudatcustomer/create_ccc_infrastructure_details.go +++ b/computecloudatcustomer/create_ccc_infrastructure_details.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/create_ccc_schedule_event.go b/computecloudatcustomer/create_ccc_schedule_event.go index cb4f8acbe1..0df2ed9f26 100644 --- a/computecloudatcustomer/create_ccc_schedule_event.go +++ b/computecloudatcustomer/create_ccc_schedule_event.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/create_ccc_upgrade_schedule_details.go b/computecloudatcustomer/create_ccc_upgrade_schedule_details.go index bf77c11389..1691d94c9b 100644 --- a/computecloudatcustomer/create_ccc_upgrade_schedule_details.go +++ b/computecloudatcustomer/create_ccc_upgrade_schedule_details.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/peer_information.go b/computecloudatcustomer/peer_information.go index 1737ec6a2b..1cfc54aabd 100644 --- a/computecloudatcustomer/peer_information.go +++ b/computecloudatcustomer/peer_information.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/sort_order.go b/computecloudatcustomer/sort_order.go index 475c9d04e2..165135ba39 100644 --- a/computecloudatcustomer/sort_order.go +++ b/computecloudatcustomer/sort_order.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/update_ccc_infrastructure_details.go b/computecloudatcustomer/update_ccc_infrastructure_details.go index d3c92236b7..5488299ed5 100644 --- a/computecloudatcustomer/update_ccc_infrastructure_details.go +++ b/computecloudatcustomer/update_ccc_infrastructure_details.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/update_ccc_schedule_event.go b/computecloudatcustomer/update_ccc_schedule_event.go index 00b70cbc5a..8923ce2185 100644 --- a/computecloudatcustomer/update_ccc_schedule_event.go +++ b/computecloudatcustomer/update_ccc_schedule_event.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/computecloudatcustomer/update_ccc_upgrade_schedule_details.go b/computecloudatcustomer/update_ccc_upgrade_schedule_details.go index dba5fd4ac9..18821ad699 100644 --- a/computecloudatcustomer/update_ccc_upgrade_schedule_details.go +++ b/computecloudatcustomer/update_ccc_upgrade_schedule_details.go @@ -4,9 +4,8 @@ // Compute Cloud@Customer API // -// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments -// and scheduled upgrades. For more information see -// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer infrastructures and upgrade schedules. +// For more information see Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/compute-cloud-at-customer/home.htm). // package computecloudatcustomer diff --git a/database/autonomous_container_database.go b/database/autonomous_container_database.go index dadc1eda80..8bd3e33d8c 100644 --- a/database/autonomous_container_database.go +++ b/database/autonomous_container_database.go @@ -156,6 +156,9 @@ type AutonomousContainerDatabase struct { // The largest Autonomous Database (CPU) that can be created in a new Autonomous Container Database. LargestProvisionableAutonomousDatabaseInCpus *float32 `mandatory:"false" json:"largestProvisionableAutonomousDatabaseInCpus"` + + // The timestamp of last successful backup. Here NULL value represents either there are no successful backups or backups are not configured for this Autonomous Container Database. + TimeOfLastBackup *common.SDKTime `mandatory:"false" json:"timeOfLastBackup"` } func (m AutonomousContainerDatabase) String() string { diff --git a/database/autonomous_container_database_backup_config.go b/database/autonomous_container_database_backup_config.go index 8f73de004d..99315a30e9 100644 --- a/database/autonomous_container_database_backup_config.go +++ b/database/autonomous_container_database_backup_config.go @@ -24,6 +24,7 @@ type AutonomousContainerDatabaseBackupConfig struct { // Number of days between the current and the earliest point of recoverability covered by automatic backups. // This value applies to automatic backups. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. // When the value is updated, it is applied to all existing automatic backups. + // If the number of specified days is 0 then there will be no backups. RecoveryWindowInDays *int `mandatory:"false" json:"recoveryWindowInDays"` } diff --git a/database/autonomous_container_database_summary.go b/database/autonomous_container_database_summary.go index e23b449229..13ea16af97 100644 --- a/database/autonomous_container_database_summary.go +++ b/database/autonomous_container_database_summary.go @@ -156,6 +156,9 @@ type AutonomousContainerDatabaseSummary struct { // The largest Autonomous Database (CPU) that can be created in a new Autonomous Container Database. LargestProvisionableAutonomousDatabaseInCpus *float32 `mandatory:"false" json:"largestProvisionableAutonomousDatabaseInCpus"` + + // The timestamp of last successful backup. Here NULL value represents either there are no successful backups or backups are not configured for this Autonomous Container Database. + TimeOfLastBackup *common.SDKTime `mandatory:"false" json:"timeOfLastBackup"` } func (m AutonomousContainerDatabaseSummary) String() string { diff --git a/database/autonomous_vm_cluster.go b/database/autonomous_vm_cluster.go index 3272f31bfc..99a02e9962 100644 --- a/database/autonomous_vm_cluster.go +++ b/database/autonomous_vm_cluster.go @@ -162,6 +162,15 @@ type AutonomousVmCluster struct { // The date and time of the ORDS certificate expiration. TimeOrdsCertificateExpires *common.SDKTime `mandatory:"false" json:"timeOrdsCertificateExpires"` + + // The lowest value to which exadataStorage in TBs can be scaled down. + ExadataStorageInTBsLowestScaledValue *float64 `mandatory:"false" json:"exadataStorageInTBsLowestScaledValue"` + + // The lowest value to which cpus can be scaled down. + CpusLowestScaledValue *int `mandatory:"false" json:"cpusLowestScaledValue"` + + // The lowest value to which ACDs can be scaled down. + MaxAcdsLowestScaledValue *int `mandatory:"false" json:"maxAcdsLowestScaledValue"` } func (m AutonomousVmCluster) String() string { diff --git a/database/autonomous_vm_cluster_summary.go b/database/autonomous_vm_cluster_summary.go index 27be293f9d..84d7f4ec9d 100644 --- a/database/autonomous_vm_cluster_summary.go +++ b/database/autonomous_vm_cluster_summary.go @@ -162,6 +162,15 @@ type AutonomousVmClusterSummary struct { // The date and time of the ORDS certificate expiration. TimeOrdsCertificateExpires *common.SDKTime `mandatory:"false" json:"timeOrdsCertificateExpires"` + + // The lowest value to which exadataStorage in TBs can be scaled down. + ExadataStorageInTBsLowestScaledValue *float64 `mandatory:"false" json:"exadataStorageInTBsLowestScaledValue"` + + // The lowest value to which cpus can be scaled down. + CpusLowestScaledValue *int `mandatory:"false" json:"cpusLowestScaledValue"` + + // The lowest value to which ACDs can be scaled down. + MaxAcdsLowestScaledValue *int `mandatory:"false" json:"maxAcdsLowestScaledValue"` } func (m AutonomousVmClusterSummary) String() string { diff --git a/database/cloud_autonomous_vm_cluster.go b/database/cloud_autonomous_vm_cluster.go index 5373b6ddb2..d38a38cedd 100644 --- a/database/cloud_autonomous_vm_cluster.go +++ b/database/cloud_autonomous_vm_cluster.go @@ -194,6 +194,15 @@ type CloudAutonomousVmCluster struct { // The number of non-provisionable Autonomous Container Databases in an Autonomous VM Cluster. NonProvisionableAutonomousContainerDatabases *int `mandatory:"false" json:"nonProvisionableAutonomousContainerDatabases"` + + // The lowest value to which exadataStorage in TBs can be scaled down. + ExadataStorageInTBsLowestScaledValue *float64 `mandatory:"false" json:"exadataStorageInTBsLowestScaledValue"` + + // The lowest value to which ocpus can be scaled down. + OcpusLowestScaledValue *int `mandatory:"false" json:"ocpusLowestScaledValue"` + + // The lowest value to which ACDs can be scaled down. + MaxAcdsLowestScaledValue *int `mandatory:"false" json:"maxAcdsLowestScaledValue"` } func (m CloudAutonomousVmCluster) String() string { diff --git a/database/cloud_autonomous_vm_cluster_summary.go b/database/cloud_autonomous_vm_cluster_summary.go index 4ef0ce83c8..0d53f82e4a 100644 --- a/database/cloud_autonomous_vm_cluster_summary.go +++ b/database/cloud_autonomous_vm_cluster_summary.go @@ -194,6 +194,15 @@ type CloudAutonomousVmClusterSummary struct { // The number of non-provisionable Autonomous Container Databases in an Autonomous VM Cluster. NonProvisionableAutonomousContainerDatabases *int `mandatory:"false" json:"nonProvisionableAutonomousContainerDatabases"` + + // The lowest value to which exadataStorage in TBs can be scaled down. + ExadataStorageInTBsLowestScaledValue *float64 `mandatory:"false" json:"exadataStorageInTBsLowestScaledValue"` + + // The lowest value to which ocpus can be scaled down. + OcpusLowestScaledValue *int `mandatory:"false" json:"ocpusLowestScaledValue"` + + // The lowest value to which ACDs can be scaled down. + MaxAcdsLowestScaledValue *int `mandatory:"false" json:"maxAcdsLowestScaledValue"` } func (m CloudAutonomousVmClusterSummary) String() string { diff --git a/database/console_history.go b/database/console_history.go new file mode 100644 index 0000000000..e78d565dc3 --- /dev/null +++ b/database/console_history.go @@ -0,0 +1,127 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ConsoleHistory The details of the Db Node console history. +type ConsoleHistory struct { + + // The OCID of the console history. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment containing the console history. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the database node. + DbNodeId *string `mandatory:"true" json:"dbNodeId"` + + // The current state of the console history. + LifecycleState ConsoleHistoryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the console history was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The user-friendly name for the console history. The name does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` +} + +func (m ConsoleHistory) String() string { + return common.PointerString(m) +} + +// 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 (m ConsoleHistory) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingConsoleHistoryLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetConsoleHistoryLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ConsoleHistoryLifecycleStateEnum Enum with underlying type: string +type ConsoleHistoryLifecycleStateEnum string + +// Set of constants representing the allowable values for ConsoleHistoryLifecycleStateEnum +const ( + ConsoleHistoryLifecycleStateRequested ConsoleHistoryLifecycleStateEnum = "REQUESTED" + ConsoleHistoryLifecycleStateGettingHistory ConsoleHistoryLifecycleStateEnum = "GETTING_HISTORY" + ConsoleHistoryLifecycleStateSucceeded ConsoleHistoryLifecycleStateEnum = "SUCCEEDED" + ConsoleHistoryLifecycleStateFailed ConsoleHistoryLifecycleStateEnum = "FAILED" + ConsoleHistoryLifecycleStateDeleted ConsoleHistoryLifecycleStateEnum = "DELETED" + ConsoleHistoryLifecycleStateDeleting ConsoleHistoryLifecycleStateEnum = "DELETING" +) + +var mappingConsoleHistoryLifecycleStateEnum = map[string]ConsoleHistoryLifecycleStateEnum{ + "REQUESTED": ConsoleHistoryLifecycleStateRequested, + "GETTING_HISTORY": ConsoleHistoryLifecycleStateGettingHistory, + "SUCCEEDED": ConsoleHistoryLifecycleStateSucceeded, + "FAILED": ConsoleHistoryLifecycleStateFailed, + "DELETED": ConsoleHistoryLifecycleStateDeleted, + "DELETING": ConsoleHistoryLifecycleStateDeleting, +} + +var mappingConsoleHistoryLifecycleStateEnumLowerCase = map[string]ConsoleHistoryLifecycleStateEnum{ + "requested": ConsoleHistoryLifecycleStateRequested, + "getting_history": ConsoleHistoryLifecycleStateGettingHistory, + "succeeded": ConsoleHistoryLifecycleStateSucceeded, + "failed": ConsoleHistoryLifecycleStateFailed, + "deleted": ConsoleHistoryLifecycleStateDeleted, + "deleting": ConsoleHistoryLifecycleStateDeleting, +} + +// GetConsoleHistoryLifecycleStateEnumValues Enumerates the set of values for ConsoleHistoryLifecycleStateEnum +func GetConsoleHistoryLifecycleStateEnumValues() []ConsoleHistoryLifecycleStateEnum { + values := make([]ConsoleHistoryLifecycleStateEnum, 0) + for _, v := range mappingConsoleHistoryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetConsoleHistoryLifecycleStateEnumStringValues Enumerates the set of values in String for ConsoleHistoryLifecycleStateEnum +func GetConsoleHistoryLifecycleStateEnumStringValues() []string { + return []string{ + "REQUESTED", + "GETTING_HISTORY", + "SUCCEEDED", + "FAILED", + "DELETED", + "DELETING", + } +} + +// GetMappingConsoleHistoryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingConsoleHistoryLifecycleStateEnum(val string) (ConsoleHistoryLifecycleStateEnum, bool) { + enum, ok := mappingConsoleHistoryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/console_history_collection.go b/database/console_history_collection.go new file mode 100644 index 0000000000..50e37bbd2b --- /dev/null +++ b/database/console_history_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ConsoleHistoryCollection Results of the Db Node console history lists. Contains ConsoleHistorySummary items. +type ConsoleHistoryCollection struct { + + // List of Db Node console histories. + Items []ConsoleHistorySummary `mandatory:"true" json:"items"` +} + +func (m ConsoleHistoryCollection) String() string { + return common.PointerString(m) +} + +// 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 (m ConsoleHistoryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/console_history_summary.go b/database/console_history_summary.go new file mode 100644 index 0000000000..b60c535816 --- /dev/null +++ b/database/console_history_summary.go @@ -0,0 +1,127 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ConsoleHistorySummary The details of the Db Node console history. +type ConsoleHistorySummary struct { + + // The OCID of the console history. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment containing the console history. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the database node. + DbNodeId *string `mandatory:"true" json:"dbNodeId"` + + // The current state of the console history. + LifecycleState ConsoleHistorySummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the console history was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The user-friendly name for the console history. The name does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` +} + +func (m ConsoleHistorySummary) String() string { + return common.PointerString(m) +} + +// 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 (m ConsoleHistorySummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingConsoleHistorySummaryLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetConsoleHistorySummaryLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ConsoleHistorySummaryLifecycleStateEnum Enum with underlying type: string +type ConsoleHistorySummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for ConsoleHistorySummaryLifecycleStateEnum +const ( + ConsoleHistorySummaryLifecycleStateRequested ConsoleHistorySummaryLifecycleStateEnum = "REQUESTED" + ConsoleHistorySummaryLifecycleStateGettingHistory ConsoleHistorySummaryLifecycleStateEnum = "GETTING_HISTORY" + ConsoleHistorySummaryLifecycleStateSucceeded ConsoleHistorySummaryLifecycleStateEnum = "SUCCEEDED" + ConsoleHistorySummaryLifecycleStateFailed ConsoleHistorySummaryLifecycleStateEnum = "FAILED" + ConsoleHistorySummaryLifecycleStateDeleted ConsoleHistorySummaryLifecycleStateEnum = "DELETED" + ConsoleHistorySummaryLifecycleStateDeleting ConsoleHistorySummaryLifecycleStateEnum = "DELETING" +) + +var mappingConsoleHistorySummaryLifecycleStateEnum = map[string]ConsoleHistorySummaryLifecycleStateEnum{ + "REQUESTED": ConsoleHistorySummaryLifecycleStateRequested, + "GETTING_HISTORY": ConsoleHistorySummaryLifecycleStateGettingHistory, + "SUCCEEDED": ConsoleHistorySummaryLifecycleStateSucceeded, + "FAILED": ConsoleHistorySummaryLifecycleStateFailed, + "DELETED": ConsoleHistorySummaryLifecycleStateDeleted, + "DELETING": ConsoleHistorySummaryLifecycleStateDeleting, +} + +var mappingConsoleHistorySummaryLifecycleStateEnumLowerCase = map[string]ConsoleHistorySummaryLifecycleStateEnum{ + "requested": ConsoleHistorySummaryLifecycleStateRequested, + "getting_history": ConsoleHistorySummaryLifecycleStateGettingHistory, + "succeeded": ConsoleHistorySummaryLifecycleStateSucceeded, + "failed": ConsoleHistorySummaryLifecycleStateFailed, + "deleted": ConsoleHistorySummaryLifecycleStateDeleted, + "deleting": ConsoleHistorySummaryLifecycleStateDeleting, +} + +// GetConsoleHistorySummaryLifecycleStateEnumValues Enumerates the set of values for ConsoleHistorySummaryLifecycleStateEnum +func GetConsoleHistorySummaryLifecycleStateEnumValues() []ConsoleHistorySummaryLifecycleStateEnum { + values := make([]ConsoleHistorySummaryLifecycleStateEnum, 0) + for _, v := range mappingConsoleHistorySummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetConsoleHistorySummaryLifecycleStateEnumStringValues Enumerates the set of values in String for ConsoleHistorySummaryLifecycleStateEnum +func GetConsoleHistorySummaryLifecycleStateEnumStringValues() []string { + return []string{ + "REQUESTED", + "GETTING_HISTORY", + "SUCCEEDED", + "FAILED", + "DELETED", + "DELETING", + } +} + +// GetMappingConsoleHistorySummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingConsoleHistorySummaryLifecycleStateEnum(val string) (ConsoleHistorySummaryLifecycleStateEnum, bool) { + enum, ok := mappingConsoleHistorySummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/create_cloud_vm_cluster_details.go b/database/create_cloud_vm_cluster_details.go index 28791dcb30..a266c642cd 100644 --- a/database/create_cloud_vm_cluster_details.go +++ b/database/create_cloud_vm_cluster_details.go @@ -123,6 +123,9 @@ type CreateCloudVmClusterDetails struct { DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` DataCollectionOptions *DataCollectionOptions `mandatory:"false" json:"dataCollectionOptions"` + + // Operating system version of the image. + SystemVersion *string `mandatory:"false" json:"systemVersion"` } func (m CreateCloudVmClusterDetails) String() string { diff --git a/database/create_console_history_details.go b/database/create_console_history_details.go new file mode 100644 index 0000000000..83bbdc3d5d --- /dev/null +++ b/database/create_console_history_details.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateConsoleHistoryDetails The details for creating a Db node console history. +// The Db node console history is created in the same compartment as the dbNode. +type CreateConsoleHistoryDetails struct { + + // The user-friendly name for the console history. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateConsoleHistoryDetails) String() string { + return common.PointerString(m) +} + +// 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 (m CreateConsoleHistoryDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/create_console_history_request_response.go b/database/create_console_history_request_response.go new file mode 100644 index 0000000000..9b1eaf3f80 --- /dev/null +++ b/database/create_console_history_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, 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" +) + +// CreateConsoleHistoryRequest wrapper for the CreateConsoleHistory operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateConsoleHistory.go.html to see an example of how to use CreateConsoleHistoryRequest. +type CreateConsoleHistoryRequest struct { + + // Request object for creating a console history. + CreateConsoleHistoryDetails `contributesTo:"body"` + + // The database node OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + DbNodeId *string `mandatory:"true" contributesTo:"path" name:"dbNodeId"` + + // 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"` + + // 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 CreateConsoleHistoryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateConsoleHistoryRequest) 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 CreateConsoleHistoryRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateConsoleHistoryRequest) 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 CreateConsoleHistoryRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateConsoleHistoryResponse wrapper for the CreateConsoleHistory operation +type CreateConsoleHistoryResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ConsoleHistory instance + ConsoleHistory `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` + + // 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"` +} + +func (response CreateConsoleHistoryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateConsoleHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/create_vm_cluster_details.go b/database/create_vm_cluster_details.go index d3550e76f2..6b417dd29c 100644 --- a/database/create_vm_cluster_details.go +++ b/database/create_vm_cluster_details.go @@ -80,6 +80,9 @@ type CreateVmClusterDetails struct { DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` DataCollectionOptions *DataCollectionOptions `mandatory:"false" json:"dataCollectionOptions"` + + // Operating system version of the image. + SystemVersion *string `mandatory:"false" json:"systemVersion"` } func (m CreateVmClusterDetails) String() string { diff --git a/database/database_client.go b/database/database_client.go index 9e7ba7a941..ab35a481ac 100644 --- a/database/database_client.go +++ b/database/database_client.go @@ -2903,6 +2903,68 @@ func (client DatabaseClient) createConsoleConnection(ctx context.Context, reques return response, err } +// CreateConsoleHistory Captures the most recent serial console data (up to a megabyte) for the specified database node. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateConsoleHistory.go.html to see an example of how to use CreateConsoleHistory API. +func (client DatabaseClient) CreateConsoleHistory(ctx context.Context, request CreateConsoleHistoryRequest) (response CreateConsoleHistoryResponse, 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.createConsoleHistory, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateConsoleHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateConsoleHistoryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateConsoleHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateConsoleHistoryResponse") + } + return +} + +// createConsoleHistory implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createConsoleHistory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/dbNodes/{dbNodeId}/consoleHistories", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateConsoleHistoryResponse + 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/ConsoleHistory/CreateConsoleHistory" + err = common.PostProcessServiceError(err, "Database", "CreateConsoleHistory", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateDataGuardAssociation Creates a new Data Guard association. A Data Guard association represents the replication relationship between the // specified database and a peer database. For more information, see Using Oracle Data Guard (https://docs.cloud.oracle.com/Content/Database/Tasks/usingdataguard.htm). // All Oracle Cloud Infrastructure resources, including Data Guard associations, get an Oracle-assigned, unique ID @@ -4553,6 +4615,63 @@ func (client DatabaseClient) deleteConsoleConnection(ctx context.Context, reques return response, err } +// DeleteConsoleHistory Deletes the specified database node console history. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteConsoleHistory.go.html to see an example of how to use DeleteConsoleHistory API. +func (client DatabaseClient) DeleteConsoleHistory(ctx context.Context, request DeleteConsoleHistoryRequest) (response DeleteConsoleHistoryResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteConsoleHistory, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteConsoleHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteConsoleHistoryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteConsoleHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteConsoleHistoryResponse") + } + return +} + +// deleteConsoleHistory implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteConsoleHistory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/dbNodes/{dbNodeId}/consoleHistories/{consoleHistoryId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteConsoleHistoryResponse + 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/ConsoleHistory/DeleteConsoleHistory" + err = common.PostProcessServiceError(err, "Database", "DeleteConsoleHistory", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteDatabase Deletes the specified database. Applies only to Exadata systems. // The data in this database is local to the Exadata system and will be lost when the database is deleted. Oracle recommends that you back up any data in the Exadata system prior to deleting it. You can use the `performFinalBackup` parameter to have the Exadata system database backed up before it is deleted. // @@ -8811,6 +8930,119 @@ func (client DatabaseClient) getConsoleConnection(ctx context.Context, request c return response, err } +// GetConsoleHistory Gets information about the specified database node console history. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetConsoleHistory.go.html to see an example of how to use GetConsoleHistory API. +func (client DatabaseClient) GetConsoleHistory(ctx context.Context, request GetConsoleHistoryRequest) (response GetConsoleHistoryResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getConsoleHistory, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetConsoleHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetConsoleHistoryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetConsoleHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetConsoleHistoryResponse") + } + return +} + +// getConsoleHistory implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getConsoleHistory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbNodes/{dbNodeId}/consoleHistories/{consoleHistoryId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetConsoleHistoryResponse + 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/ConsoleHistory/GetConsoleHistory" + err = common.PostProcessServiceError(err, "Database", "GetConsoleHistory", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetConsoleHistoryContent Retrieves the specified database node console history contents upto a megabyte. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetConsoleHistoryContent.go.html to see an example of how to use GetConsoleHistoryContent API. +func (client DatabaseClient) GetConsoleHistoryContent(ctx context.Context, request GetConsoleHistoryContentRequest) (response GetConsoleHistoryContentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getConsoleHistoryContent, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetConsoleHistoryContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetConsoleHistoryContentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetConsoleHistoryContentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetConsoleHistoryContentResponse") + } + return +} + +// getConsoleHistoryContent implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getConsoleHistoryContent(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbNodes/{dbNodeId}/consoleHistories/{consoleHistoryId}/content", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetConsoleHistoryContentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ConsoleHistory/GetConsoleHistoryContent" + err = common.PostProcessServiceError(err, "Database", "GetConsoleHistoryContent", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetDataGuardAssociation Gets the specified Data Guard association's configuration information. // // # See also @@ -12432,6 +12664,63 @@ func (client DatabaseClient) listConsoleConnections(ctx context.Context, request return response, err } +// ListConsoleHistories Lists the console histories for the specified database node. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListConsoleHistories.go.html to see an example of how to use ListConsoleHistories API. +func (client DatabaseClient) ListConsoleHistories(ctx context.Context, request ListConsoleHistoriesRequest) (response ListConsoleHistoriesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listConsoleHistories, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListConsoleHistoriesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListConsoleHistoriesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListConsoleHistoriesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListConsoleHistoriesResponse") + } + return +} + +// listConsoleHistories implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listConsoleHistories(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dbNodes/{dbNodeId}/consoleHistories", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListConsoleHistoriesResponse + 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/ConsoleHistory/ListConsoleHistories" + err = common.PostProcessServiceError(err, "Database", "ListConsoleHistories", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListContainerDatabasePatches Lists the patches applicable to the requested container database. // // # See also @@ -14219,6 +14508,63 @@ func (client DatabaseClient) listPluggableDatabases(ctx context.Context, request return response, err } +// ListSystemVersions Gets a list of supported Exadata system versions for a given shape and GI version. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListSystemVersions.go.html to see an example of how to use ListSystemVersions API. +func (client DatabaseClient) ListSystemVersions(ctx context.Context, request ListSystemVersionsRequest) (response ListSystemVersionsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listSystemVersions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListSystemVersionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListSystemVersionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListSystemVersionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListSystemVersionsResponse") + } + return +} + +// listSystemVersions implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listSystemVersions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/systemVersions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListSystemVersionsResponse + 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/SystemVersionCollection/ListSystemVersions" + err = common.PostProcessServiceError(err, "Database", "ListSystemVersions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListVmClusterNetworks Gets a list of the VM cluster networks in the specified compartment. Applies to Exadata Cloud@Customer instances only. // // # See also @@ -17835,6 +18181,63 @@ func (client DatabaseClient) updateConsoleConnection(ctx context.Context, reques return response, err } +// UpdateConsoleHistory Updates the specified database node console history. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateConsoleHistory.go.html to see an example of how to use UpdateConsoleHistory API. +func (client DatabaseClient) UpdateConsoleHistory(ctx context.Context, request UpdateConsoleHistoryRequest) (response UpdateConsoleHistoryResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateConsoleHistory, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateConsoleHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateConsoleHistoryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateConsoleHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateConsoleHistoryResponse") + } + return +} + +// updateConsoleHistory implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateConsoleHistory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/dbNodes/{dbNodeId}/consoleHistories/{consoleHistoryId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateConsoleHistoryResponse + 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/ConsoleHistory/UpdateConsoleHistory" + err = common.PostProcessServiceError(err, "Database", "UpdateConsoleHistory", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateDataGuardAssociation Updates the Data Guard association the specified database. This API can be used to change the `protectionMode` and `transportType` of the Data Guard association. // // # See also diff --git a/database/db_system_upgrade_history_entry.go b/database/db_system_upgrade_history_entry.go index 3915b3bd69..5f89d5f982 100644 --- a/database/db_system_upgrade_history_entry.go +++ b/database/db_system_upgrade_history_entry.go @@ -25,12 +25,6 @@ type DbSystemUpgradeHistoryEntry struct { // The operating system upgrade action. Action DbSystemUpgradeHistoryEntryActionEnum `mandatory:"true" json:"action"` - // A valid Oracle Grid Infrastructure (GI) software version. - NewGiVersion *string `mandatory:"true" json:"newGiVersion"` - - // A valid Oracle Grid Infrastructure (GI) software version. - OldGiVersion *string `mandatory:"true" json:"oldGiVersion"` - // The retention period, in days, for the snapshot that allows you to perform a rollback of the upgrade operation. After this number of days passes, you cannot roll back the upgrade. SnapshotRetentionPeriodInDays *int `mandatory:"true" json:"snapshotRetentionPeriodInDays"` @@ -40,6 +34,18 @@ type DbSystemUpgradeHistoryEntry struct { // The date and time when the upgrade action started. TimeStarted *common.SDKTime `mandatory:"true" json:"timeStarted"` + // A valid Oracle Grid Infrastructure (GI) software version. + NewGiVersion *string `mandatory:"false" json:"newGiVersion"` + + // A valid Oracle Grid Infrastructure (GI) software version. + OldGiVersion *string `mandatory:"false" json:"oldGiVersion"` + + // A valid Oracle Software (OS) version eg. Oracle Linux Server release 8 + OldOsVersion *string `mandatory:"false" json:"oldOsVersion"` + + // A valid Oracle Software (OS) version eg. Oracle Linux Server release 8 + NewOsVersion *string `mandatory:"false" json:"newOsVersion"` + // A descriptive text associated with the lifecycleState. // Typically contains additional displayable text. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` diff --git a/database/db_system_upgrade_history_entry_summary.go b/database/db_system_upgrade_history_entry_summary.go index f9aa3a3718..c323246d4d 100644 --- a/database/db_system_upgrade_history_entry_summary.go +++ b/database/db_system_upgrade_history_entry_summary.go @@ -24,12 +24,6 @@ type DbSystemUpgradeHistoryEntrySummary struct { // The operating system upgrade action. Action DbSystemUpgradeHistoryEntrySummaryActionEnum `mandatory:"true" json:"action"` - // A valid Oracle Grid Infrastructure (GI) software version. - NewGiVersion *string `mandatory:"true" json:"newGiVersion"` - - // A valid Oracle Grid Infrastructure (GI) software version. - OldGiVersion *string `mandatory:"true" json:"oldGiVersion"` - // The retention period, in days, for the snapshot that allows you to perform a rollback of the upgrade operation. After this number of days passes, you cannot roll back the upgrade. SnapshotRetentionPeriodInDays *int `mandatory:"true" json:"snapshotRetentionPeriodInDays"` @@ -39,6 +33,18 @@ type DbSystemUpgradeHistoryEntrySummary struct { // The date and time when the upgrade action started. TimeStarted *common.SDKTime `mandatory:"true" json:"timeStarted"` + // A valid Oracle Grid Infrastructure (GI) software version. + NewGiVersion *string `mandatory:"false" json:"newGiVersion"` + + // A valid Oracle Grid Infrastructure (GI) software version. + OldGiVersion *string `mandatory:"false" json:"oldGiVersion"` + + // A valid Oracle Software (OS) version eg. Oracle Linux Server release 8 + OldOsVersion *string `mandatory:"false" json:"oldOsVersion"` + + // A valid Oracle Software (OS) version eg. Oracle Linux Server release 8 + NewOsVersion *string `mandatory:"false" json:"newOsVersion"` + // A descriptive text associated with the lifecycleState. // Typically contains additional displayable text. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` diff --git a/database/delete_console_history_request_response.go b/database/delete_console_history_request_response.go new file mode 100644 index 0000000000..c819025cd2 --- /dev/null +++ b/database/delete_console_history_request_response.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2023, 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" +) + +// DeleteConsoleHistoryRequest wrapper for the DeleteConsoleHistory operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteConsoleHistory.go.html to see an example of how to use DeleteConsoleHistoryRequest. +type DeleteConsoleHistoryRequest struct { + + // The database node OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + DbNodeId *string `mandatory:"true" contributesTo:"path" name:"dbNodeId"` + + // The OCID of the console history. + ConsoleHistoryId *string `mandatory:"true" contributesTo:"path" name:"consoleHistoryId"` + + // 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"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteConsoleHistoryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteConsoleHistoryRequest) 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 DeleteConsoleHistoryRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteConsoleHistoryRequest) 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 DeleteConsoleHistoryRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteConsoleHistoryResponse wrapper for the DeleteConsoleHistory operation +type DeleteConsoleHistoryResponse 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 DeleteConsoleHistoryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteConsoleHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/get_console_history_content_request_response.go b/database/get_console_history_content_request_response.go new file mode 100644 index 0000000000..2dec7a6837 --- /dev/null +++ b/database/get_console_history_content_request_response.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2023, 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" + "io" + "net/http" + "strings" +) + +// GetConsoleHistoryContentRequest wrapper for the GetConsoleHistoryContent operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetConsoleHistoryContent.go.html to see an example of how to use GetConsoleHistoryContentRequest. +type GetConsoleHistoryContentRequest struct { + + // The database node OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + DbNodeId *string `mandatory:"true" contributesTo:"path" name:"dbNodeId"` + + // The OCID of the console history. + ConsoleHistoryId *string `mandatory:"true" contributesTo:"path" name:"consoleHistoryId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetConsoleHistoryContentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetConsoleHistoryContentRequest) 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 GetConsoleHistoryContentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetConsoleHistoryContentRequest) 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 GetConsoleHistoryContentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetConsoleHistoryContentResponse wrapper for the GetConsoleHistoryContent operation +type GetConsoleHistoryContentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // 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"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetConsoleHistoryContentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetConsoleHistoryContentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/get_console_history_request_response.go b/database/get_console_history_request_response.go new file mode 100644 index 0000000000..dac75b5a87 --- /dev/null +++ b/database/get_console_history_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, 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" +) + +// GetConsoleHistoryRequest wrapper for the GetConsoleHistory operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetConsoleHistory.go.html to see an example of how to use GetConsoleHistoryRequest. +type GetConsoleHistoryRequest struct { + + // The database node OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + DbNodeId *string `mandatory:"true" contributesTo:"path" name:"dbNodeId"` + + // The OCID of the console history. + ConsoleHistoryId *string `mandatory:"true" contributesTo:"path" name:"consoleHistoryId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetConsoleHistoryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetConsoleHistoryRequest) 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 GetConsoleHistoryRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetConsoleHistoryRequest) 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 GetConsoleHistoryRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetConsoleHistoryResponse wrapper for the GetConsoleHistory operation +type GetConsoleHistoryResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ConsoleHistory instance + ConsoleHistory `presentIn:"body"` + + // 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"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetConsoleHistoryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetConsoleHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/list_console_histories_request_response.go b/database/list_console_histories_request_response.go new file mode 100644 index 0000000000..d5f1166e3d --- /dev/null +++ b/database/list_console_histories_request_response.go @@ -0,0 +1,207 @@ +// Copyright (c) 2016, 2018, 2023, 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" +) + +// ListConsoleHistoriesRequest wrapper for the ListConsoleHistories operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListConsoleHistories.go.html to see an example of how to use ListConsoleHistoriesRequest. +type ListConsoleHistoriesRequest struct { + + // The database node OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + DbNodeId *string `mandatory:"true" contributesTo:"path" name:"dbNodeId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + SortBy ListConsoleHistoriesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListConsoleHistoriesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState ConsoleHistorySummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // 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 ListConsoleHistoriesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListConsoleHistoriesRequest) 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 ListConsoleHistoriesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListConsoleHistoriesRequest) 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 ListConsoleHistoriesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListConsoleHistoriesSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListConsoleHistoriesSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListConsoleHistoriesSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListConsoleHistoriesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingConsoleHistorySummaryLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetConsoleHistorySummaryLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListConsoleHistoriesResponse wrapper for the ListConsoleHistories operation +type ListConsoleHistoriesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ConsoleHistoryCollection instances + ConsoleHistoryCollection `presentIn:"body"` + + // 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"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListConsoleHistoriesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListConsoleHistoriesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListConsoleHistoriesSortByEnum Enum with underlying type: string +type ListConsoleHistoriesSortByEnum string + +// Set of constants representing the allowable values for ListConsoleHistoriesSortByEnum +const ( + ListConsoleHistoriesSortByTimecreated ListConsoleHistoriesSortByEnum = "TIMECREATED" + ListConsoleHistoriesSortByDisplayname ListConsoleHistoriesSortByEnum = "DISPLAYNAME" +) + +var mappingListConsoleHistoriesSortByEnum = map[string]ListConsoleHistoriesSortByEnum{ + "TIMECREATED": ListConsoleHistoriesSortByTimecreated, + "DISPLAYNAME": ListConsoleHistoriesSortByDisplayname, +} + +var mappingListConsoleHistoriesSortByEnumLowerCase = map[string]ListConsoleHistoriesSortByEnum{ + "timecreated": ListConsoleHistoriesSortByTimecreated, + "displayname": ListConsoleHistoriesSortByDisplayname, +} + +// GetListConsoleHistoriesSortByEnumValues Enumerates the set of values for ListConsoleHistoriesSortByEnum +func GetListConsoleHistoriesSortByEnumValues() []ListConsoleHistoriesSortByEnum { + values := make([]ListConsoleHistoriesSortByEnum, 0) + for _, v := range mappingListConsoleHistoriesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListConsoleHistoriesSortByEnumStringValues Enumerates the set of values in String for ListConsoleHistoriesSortByEnum +func GetListConsoleHistoriesSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListConsoleHistoriesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListConsoleHistoriesSortByEnum(val string) (ListConsoleHistoriesSortByEnum, bool) { + enum, ok := mappingListConsoleHistoriesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListConsoleHistoriesSortOrderEnum Enum with underlying type: string +type ListConsoleHistoriesSortOrderEnum string + +// Set of constants representing the allowable values for ListConsoleHistoriesSortOrderEnum +const ( + ListConsoleHistoriesSortOrderAsc ListConsoleHistoriesSortOrderEnum = "ASC" + ListConsoleHistoriesSortOrderDesc ListConsoleHistoriesSortOrderEnum = "DESC" +) + +var mappingListConsoleHistoriesSortOrderEnum = map[string]ListConsoleHistoriesSortOrderEnum{ + "ASC": ListConsoleHistoriesSortOrderAsc, + "DESC": ListConsoleHistoriesSortOrderDesc, +} + +var mappingListConsoleHistoriesSortOrderEnumLowerCase = map[string]ListConsoleHistoriesSortOrderEnum{ + "asc": ListConsoleHistoriesSortOrderAsc, + "desc": ListConsoleHistoriesSortOrderDesc, +} + +// GetListConsoleHistoriesSortOrderEnumValues Enumerates the set of values for ListConsoleHistoriesSortOrderEnum +func GetListConsoleHistoriesSortOrderEnumValues() []ListConsoleHistoriesSortOrderEnum { + values := make([]ListConsoleHistoriesSortOrderEnum, 0) + for _, v := range mappingListConsoleHistoriesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListConsoleHistoriesSortOrderEnumStringValues Enumerates the set of values in String for ListConsoleHistoriesSortOrderEnum +func GetListConsoleHistoriesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListConsoleHistoriesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListConsoleHistoriesSortOrderEnum(val string) (ListConsoleHistoriesSortOrderEnum, bool) { + enum, ok := mappingListConsoleHistoriesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/list_system_versions_request_response.go b/database/list_system_versions_request_response.go new file mode 100644 index 0000000000..3945f6479a --- /dev/null +++ b/database/list_system_versions_request_response.go @@ -0,0 +1,156 @@ +// Copyright (c) 2016, 2018, 2023, 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" +) + +// ListSystemVersionsRequest wrapper for the ListSystemVersions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListSystemVersions.go.html to see an example of how to use ListSystemVersionsRequest. +type ListSystemVersionsRequest struct { + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Specifies shape query parameter. + Shape *string `mandatory:"true" contributesTo:"query" name:"shape"` + + // Specifies gi version query parameter. + GiVersion *string `mandatory:"true" contributesTo:"query" name:"giVersion"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListSystemVersionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 ListSystemVersionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSystemVersionsRequest) 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 ListSystemVersionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSystemVersionsRequest) 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 ListSystemVersionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListSystemVersionsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListSystemVersionsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSystemVersionsResponse wrapper for the ListSystemVersions operation +type ListSystemVersionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of SystemVersionCollection instances + SystemVersionCollection `presentIn:"body"` + + // 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"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListSystemVersionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSystemVersionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSystemVersionsSortOrderEnum Enum with underlying type: string +type ListSystemVersionsSortOrderEnum string + +// Set of constants representing the allowable values for ListSystemVersionsSortOrderEnum +const ( + ListSystemVersionsSortOrderAsc ListSystemVersionsSortOrderEnum = "ASC" + ListSystemVersionsSortOrderDesc ListSystemVersionsSortOrderEnum = "DESC" +) + +var mappingListSystemVersionsSortOrderEnum = map[string]ListSystemVersionsSortOrderEnum{ + "ASC": ListSystemVersionsSortOrderAsc, + "DESC": ListSystemVersionsSortOrderDesc, +} + +var mappingListSystemVersionsSortOrderEnumLowerCase = map[string]ListSystemVersionsSortOrderEnum{ + "asc": ListSystemVersionsSortOrderAsc, + "desc": ListSystemVersionsSortOrderDesc, +} + +// GetListSystemVersionsSortOrderEnumValues Enumerates the set of values for ListSystemVersionsSortOrderEnum +func GetListSystemVersionsSortOrderEnumValues() []ListSystemVersionsSortOrderEnum { + values := make([]ListSystemVersionsSortOrderEnum, 0) + for _, v := range mappingListSystemVersionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSystemVersionsSortOrderEnumStringValues Enumerates the set of values in String for ListSystemVersionsSortOrderEnum +func GetListSystemVersionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSystemVersionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSystemVersionsSortOrderEnum(val string) (ListSystemVersionsSortOrderEnum, bool) { + enum, ok := mappingListSystemVersionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/peer_autonomous_container_database_backup_config.go b/database/peer_autonomous_container_database_backup_config.go index 40777378ef..d251b34f1c 100644 --- a/database/peer_autonomous_container_database_backup_config.go +++ b/database/peer_autonomous_container_database_backup_config.go @@ -24,6 +24,7 @@ type PeerAutonomousContainerDatabaseBackupConfig struct { // Number of days between the current and the earliest point of recoverability covered by automatic backups. // This value applies to automatic backups. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. // When the value is updated, it is applied to all existing automatic backups. + // If the number of specified days is 0 then there will be no backups. RecoveryWindowInDays *int `mandatory:"false" json:"recoveryWindowInDays"` } diff --git a/database/system_version_collection.go b/database/system_version_collection.go new file mode 100644 index 0000000000..cf7b81db56 --- /dev/null +++ b/database/system_version_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SystemVersionCollection Results of the System version lists. Contains SystemVersionSummary items. +type SystemVersionCollection struct { + + // List of System versions. + Items []SystemVersionSummary `mandatory:"true" json:"items"` +} + +func (m SystemVersionCollection) String() string { + return common.PointerString(m) +} + +// 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 (m SystemVersionCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/system_version_summary.go b/database/system_version_summary.go new file mode 100644 index 0000000000..bf52c56233 --- /dev/null +++ b/database/system_version_summary.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SystemVersionSummary List of compatible Exadata system versions for a given shape and GI version. +type SystemVersionSummary struct { + + // Exadata shape. + Shape *string `mandatory:"true" json:"shape"` + + // Grid Infrastructure version. + GiVersion *string `mandatory:"true" json:"giVersion"` + + // Compatible Exadata system versions for a given shape and GI version. + SystemVersions []string `mandatory:"false" json:"systemVersions"` +} + +func (m SystemVersionSummary) String() string { + return common.PointerString(m) +} + +// 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 (m SystemVersionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/update_autonomous_vm_cluster_details.go b/database/update_autonomous_vm_cluster_details.go index a54dfca103..f4fbfb74f6 100644 --- a/database/update_autonomous_vm_cluster_details.go +++ b/database/update_autonomous_vm_cluster_details.go @@ -30,6 +30,15 @@ type UpdateAutonomousVmClusterDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The new scaled up/down value for autonomous data storage in TBs for Autonomous VM cluster. + AutonomousDataStorageSizeInTBs *float64 `mandatory:"false" json:"autonomousDataStorageSizeInTBs"` + + // The new scaled up/down value for cpus per Autonomous VM cluster per node. + CpuCoreCountPerNode *int `mandatory:"false" json:"cpuCoreCountPerNode"` + + // The new scaled up/down value for maxACD count for Autonomous VM cluster. + TotalContainerDatabases *int `mandatory:"false" json:"totalContainerDatabases"` } func (m UpdateAutonomousVmClusterDetails) String() string { diff --git a/database/update_cloud_autonomous_vm_cluster_details.go b/database/update_cloud_autonomous_vm_cluster_details.go index 0124585984..58270ce48d 100644 --- a/database/update_cloud_autonomous_vm_cluster_details.go +++ b/database/update_cloud_autonomous_vm_cluster_details.go @@ -26,6 +26,15 @@ type UpdateCloudAutonomousVmClusterDetails struct { MaintenanceWindowDetails *MaintenanceWindow `mandatory:"false" json:"maintenanceWindowDetails"` + // The new scaled up/down value for exadata storage in TBs for cloud autonomous VM cluster. + AutonomousDataStorageSizeInTBs *float64 `mandatory:"false" json:"autonomousDataStorageSizeInTBs"` + + // The new scaled up/down value for ocpus for cloud autonomous VM cluster per node. + CpuCoreCountPerNode *int `mandatory:"false" json:"cpuCoreCountPerNode"` + + // The new scaled up/down value for maxACD count for cloud autonomous VM cluster. + TotalContainerDatabases *int `mandatory:"false" json:"totalContainerDatabases"` + // The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. // License Included allows you to subscribe to new Oracle Database software licenses and the Oracle Database service. // Note that when provisioning an Autonomous Database on dedicated Exadata infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null. It is already set at the diff --git a/database/update_console_history_details.go b/database/update_console_history_details.go new file mode 100644 index 0000000000..16343c44e0 --- /dev/null +++ b/database/update_console_history_details.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateConsoleHistoryDetails The details for updating a Db node console history. +type UpdateConsoleHistoryDetails struct { + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The user-friendly name for the console history. The name does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m UpdateConsoleHistoryDetails) String() string { + return common.PointerString(m) +} + +// 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 (m UpdateConsoleHistoryDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/update_console_history_request_response.go b/database/update_console_history_request_response.go new file mode 100644 index 0000000000..ba70acc203 --- /dev/null +++ b/database/update_console_history_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, 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" +) + +// UpdateConsoleHistoryRequest wrapper for the UpdateConsoleHistory operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateConsoleHistory.go.html to see an example of how to use UpdateConsoleHistoryRequest. +type UpdateConsoleHistoryRequest struct { + + // The database node OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + DbNodeId *string `mandatory:"true" contributesTo:"path" name:"dbNodeId"` + + // The OCID of the console history. + ConsoleHistoryId *string `mandatory:"true" contributesTo:"path" name:"consoleHistoryId"` + + // Request to update the specified database node console history. + UpdateConsoleHistoryDetails `contributesTo:"body"` + + // 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"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 UpdateConsoleHistoryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateConsoleHistoryRequest) 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 UpdateConsoleHistoryRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateConsoleHistoryRequest) 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 UpdateConsoleHistoryRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateConsoleHistoryResponse wrapper for the UpdateConsoleHistory operation +type UpdateConsoleHistoryResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ConsoleHistory instance + ConsoleHistory `presentIn:"body"` + + // 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"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateConsoleHistoryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateConsoleHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/upgrade_db_system_details.go b/database/upgrade_db_system_details.go index 41bca3d2d9..77b284ad97 100644 --- a/database/upgrade_db_system_details.go +++ b/database/upgrade_db_system_details.go @@ -27,6 +27,9 @@ type UpgradeDbSystemDetails struct { // A valid Oracle Grid Infrastructure (GI) software version. NewGiVersion *string `mandatory:"false" json:"newGiVersion"` + // A valid Oracle Software (OS) version eg. Oracle Linux Server release 8 + NewOsVersion *string `mandatory:"false" json:"newOsVersion"` + // If true, rollback time is updated even if operating system upgrade history contains errors. IsSnapshotRetentionDaysForceUpdated *bool `mandatory:"false" json:"isSnapshotRetentionDaysForceUpdated"` } diff --git a/datascience/fast_launch_job_config_summary.go b/datascience/fast_launch_job_config_summary.go index b7361265b5..7885e90b7f 100644 --- a/datascience/fast_launch_job_config_summary.go +++ b/datascience/fast_launch_job_config_summary.go @@ -68,6 +68,7 @@ const ( FastLaunchJobConfigSummaryShapeSeriesIntelSkylake FastLaunchJobConfigSummaryShapeSeriesEnum = "INTEL_SKYLAKE" FastLaunchJobConfigSummaryShapeSeriesNvidiaGpu FastLaunchJobConfigSummaryShapeSeriesEnum = "NVIDIA_GPU" FastLaunchJobConfigSummaryShapeSeriesLegacy FastLaunchJobConfigSummaryShapeSeriesEnum = "LEGACY" + FastLaunchJobConfigSummaryShapeSeriesArm FastLaunchJobConfigSummaryShapeSeriesEnum = "ARM" ) var mappingFastLaunchJobConfigSummaryShapeSeriesEnum = map[string]FastLaunchJobConfigSummaryShapeSeriesEnum{ @@ -75,6 +76,7 @@ var mappingFastLaunchJobConfigSummaryShapeSeriesEnum = map[string]FastLaunchJobC "INTEL_SKYLAKE": FastLaunchJobConfigSummaryShapeSeriesIntelSkylake, "NVIDIA_GPU": FastLaunchJobConfigSummaryShapeSeriesNvidiaGpu, "LEGACY": FastLaunchJobConfigSummaryShapeSeriesLegacy, + "ARM": FastLaunchJobConfigSummaryShapeSeriesArm, } var mappingFastLaunchJobConfigSummaryShapeSeriesEnumLowerCase = map[string]FastLaunchJobConfigSummaryShapeSeriesEnum{ @@ -82,6 +84,7 @@ var mappingFastLaunchJobConfigSummaryShapeSeriesEnumLowerCase = map[string]FastL "intel_skylake": FastLaunchJobConfigSummaryShapeSeriesIntelSkylake, "nvidia_gpu": FastLaunchJobConfigSummaryShapeSeriesNvidiaGpu, "legacy": FastLaunchJobConfigSummaryShapeSeriesLegacy, + "arm": FastLaunchJobConfigSummaryShapeSeriesArm, } // GetFastLaunchJobConfigSummaryShapeSeriesEnumValues Enumerates the set of values for FastLaunchJobConfigSummaryShapeSeriesEnum @@ -100,6 +103,7 @@ func GetFastLaunchJobConfigSummaryShapeSeriesEnumStringValues() []string { "INTEL_SKYLAKE", "NVIDIA_GPU", "LEGACY", + "ARM", } } diff --git a/datascience/job_shape_summary.go b/datascience/job_shape_summary.go index 50688fc16c..6fa667b41f 100644 --- a/datascience/job_shape_summary.go +++ b/datascience/job_shape_summary.go @@ -59,6 +59,7 @@ const ( JobShapeSummaryShapeSeriesIntelSkylake JobShapeSummaryShapeSeriesEnum = "INTEL_SKYLAKE" JobShapeSummaryShapeSeriesNvidiaGpu JobShapeSummaryShapeSeriesEnum = "NVIDIA_GPU" JobShapeSummaryShapeSeriesLegacy JobShapeSummaryShapeSeriesEnum = "LEGACY" + JobShapeSummaryShapeSeriesArm JobShapeSummaryShapeSeriesEnum = "ARM" ) var mappingJobShapeSummaryShapeSeriesEnum = map[string]JobShapeSummaryShapeSeriesEnum{ @@ -66,6 +67,7 @@ var mappingJobShapeSummaryShapeSeriesEnum = map[string]JobShapeSummaryShapeSerie "INTEL_SKYLAKE": JobShapeSummaryShapeSeriesIntelSkylake, "NVIDIA_GPU": JobShapeSummaryShapeSeriesNvidiaGpu, "LEGACY": JobShapeSummaryShapeSeriesLegacy, + "ARM": JobShapeSummaryShapeSeriesArm, } var mappingJobShapeSummaryShapeSeriesEnumLowerCase = map[string]JobShapeSummaryShapeSeriesEnum{ @@ -73,6 +75,7 @@ var mappingJobShapeSummaryShapeSeriesEnumLowerCase = map[string]JobShapeSummaryS "intel_skylake": JobShapeSummaryShapeSeriesIntelSkylake, "nvidia_gpu": JobShapeSummaryShapeSeriesNvidiaGpu, "legacy": JobShapeSummaryShapeSeriesLegacy, + "arm": JobShapeSummaryShapeSeriesArm, } // GetJobShapeSummaryShapeSeriesEnumValues Enumerates the set of values for JobShapeSummaryShapeSeriesEnum @@ -91,6 +94,7 @@ func GetJobShapeSummaryShapeSeriesEnumStringValues() []string { "INTEL_SKYLAKE", "NVIDIA_GPU", "LEGACY", + "ARM", } } diff --git a/datascience/model_deployment_shape_series.go b/datascience/model_deployment_shape_series.go index d10835d3f7..5ea7ec5d5b 100644 --- a/datascience/model_deployment_shape_series.go +++ b/datascience/model_deployment_shape_series.go @@ -22,6 +22,7 @@ const ( ModelDeploymentShapeSeriesIntelSkylake ModelDeploymentShapeSeriesEnum = "INTEL_SKYLAKE" ModelDeploymentShapeSeriesNvidiaGpu ModelDeploymentShapeSeriesEnum = "NVIDIA_GPU" ModelDeploymentShapeSeriesLegacy ModelDeploymentShapeSeriesEnum = "LEGACY" + ModelDeploymentShapeSeriesArm ModelDeploymentShapeSeriesEnum = "ARM" ) var mappingModelDeploymentShapeSeriesEnum = map[string]ModelDeploymentShapeSeriesEnum{ @@ -29,6 +30,7 @@ var mappingModelDeploymentShapeSeriesEnum = map[string]ModelDeploymentShapeSerie "INTEL_SKYLAKE": ModelDeploymentShapeSeriesIntelSkylake, "NVIDIA_GPU": ModelDeploymentShapeSeriesNvidiaGpu, "LEGACY": ModelDeploymentShapeSeriesLegacy, + "ARM": ModelDeploymentShapeSeriesArm, } var mappingModelDeploymentShapeSeriesEnumLowerCase = map[string]ModelDeploymentShapeSeriesEnum{ @@ -36,6 +38,7 @@ var mappingModelDeploymentShapeSeriesEnumLowerCase = map[string]ModelDeploymentS "intel_skylake": ModelDeploymentShapeSeriesIntelSkylake, "nvidia_gpu": ModelDeploymentShapeSeriesNvidiaGpu, "legacy": ModelDeploymentShapeSeriesLegacy, + "arm": ModelDeploymentShapeSeriesArm, } // GetModelDeploymentShapeSeriesEnumValues Enumerates the set of values for ModelDeploymentShapeSeriesEnum @@ -54,6 +57,7 @@ func GetModelDeploymentShapeSeriesEnumStringValues() []string { "INTEL_SKYLAKE", "NVIDIA_GPU", "LEGACY", + "ARM", } } diff --git a/datascience/notebook_session_shape_series.go b/datascience/notebook_session_shape_series.go index 05e68cb790..c0b2b5fd2f 100644 --- a/datascience/notebook_session_shape_series.go +++ b/datascience/notebook_session_shape_series.go @@ -22,6 +22,7 @@ const ( NotebookSessionShapeSeriesIntelSkylake NotebookSessionShapeSeriesEnum = "INTEL_SKYLAKE" NotebookSessionShapeSeriesNvidiaGpu NotebookSessionShapeSeriesEnum = "NVIDIA_GPU" NotebookSessionShapeSeriesLegacy NotebookSessionShapeSeriesEnum = "LEGACY" + NotebookSessionShapeSeriesArm NotebookSessionShapeSeriesEnum = "ARM" ) var mappingNotebookSessionShapeSeriesEnum = map[string]NotebookSessionShapeSeriesEnum{ @@ -29,6 +30,7 @@ var mappingNotebookSessionShapeSeriesEnum = map[string]NotebookSessionShapeSerie "INTEL_SKYLAKE": NotebookSessionShapeSeriesIntelSkylake, "NVIDIA_GPU": NotebookSessionShapeSeriesNvidiaGpu, "LEGACY": NotebookSessionShapeSeriesLegacy, + "ARM": NotebookSessionShapeSeriesArm, } var mappingNotebookSessionShapeSeriesEnumLowerCase = map[string]NotebookSessionShapeSeriesEnum{ @@ -36,6 +38,7 @@ var mappingNotebookSessionShapeSeriesEnumLowerCase = map[string]NotebookSessionS "intel_skylake": NotebookSessionShapeSeriesIntelSkylake, "nvidia_gpu": NotebookSessionShapeSeriesNvidiaGpu, "legacy": NotebookSessionShapeSeriesLegacy, + "arm": NotebookSessionShapeSeriesArm, } // GetNotebookSessionShapeSeriesEnumValues Enumerates the set of values for NotebookSessionShapeSeriesEnum @@ -54,6 +57,7 @@ func GetNotebookSessionShapeSeriesEnumStringValues() []string { "INTEL_SKYLAKE", "NVIDIA_GPU", "LEGACY", + "ARM", } } diff --git a/goldengate/certificate.go b/goldengate/certificate.go new file mode 100644 index 0000000000..63c3da62b5 --- /dev/null +++ b/goldengate/certificate.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// GoldenGate API +// +// Use the Oracle Cloud Infrastructure GoldenGate APIs to perform data replication operations. +// + +package goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Certificate Certificate data. +type Certificate struct { + + // The identifier key (unique name in the scope of the deployment) of the certificate being referenced. + // It must be 1 to 32 characters long, must contain only alphanumeric characters and must start with a letter. + Key *string `mandatory:"true" json:"key"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the deployment being referenced. + DeploymentId *string `mandatory:"true" json:"deploymentId"` + + // A PEM-encoded SSL certificate. + CertificateContent *string `mandatory:"true" json:"certificateContent"` + + // The Certificate issuer. + Issuer *string `mandatory:"true" json:"issuer"` + + // Indicates if the certificate is self signed. + IsSelfSigned *bool `mandatory:"true" json:"isSelfSigned"` + + // The Certificate md5Hash. + Md5Hash *string `mandatory:"true" json:"md5Hash"` + + // The Certificate public key. + PublicKey *string `mandatory:"true" json:"publicKey"` + + // The Certificate public key algorithm. + PublicKeyAlgorithm *string `mandatory:"true" json:"publicKeyAlgorithm"` + + // The Certificate public key size. + PublicKeySize *int64 `mandatory:"true" json:"publicKeySize"` + + // The Certificate serial. + Serial *string `mandatory:"true" json:"serial"` + + // The Certificate subject. + Subject *string `mandatory:"true" json:"subject"` + + // The time the certificate is valid from. The format is defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`. + TimeValidFrom *common.SDKTime `mandatory:"true" json:"timeValidFrom"` + + // The time the certificate is valid to. The format is defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`. + TimeValidTo *common.SDKTime `mandatory:"true" json:"timeValidTo"` + + // The Certificate version. + Version *string `mandatory:"true" json:"version"` + + // The Certificate sha1 hash. + Sha1Hash *string `mandatory:"true" json:"sha1Hash"` + + // The Certificate authority key id. + AuthorityKeyId *string `mandatory:"true" json:"authorityKeyId"` + + // Indicates if the certificate is ca. + IsCa *bool `mandatory:"true" json:"isCa"` + + // The Certificate subject key id. + SubjectKeyId *string `mandatory:"true" json:"subjectKeyId"` + + // Possible certificate lifecycle states. + LifecycleState CertificateLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the resource was created. The format is defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` +} + +func (m Certificate) String() string { + return common.PointerString(m) +} + +// 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 (m Certificate) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCertificateLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCertificateLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/goldengate/certificate_collection.go b/goldengate/certificate_collection.go new file mode 100644 index 0000000000..bb982e6781 --- /dev/null +++ b/goldengate/certificate_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// GoldenGate API +// +// Use the Oracle Cloud Infrastructure GoldenGate APIs to perform data replication operations. +// + +package goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CertificateCollection A list of Certificates. +type CertificateCollection struct { + + // An array of Certificates. + Items []CertificateSummary `mandatory:"true" json:"items"` +} + +func (m CertificateCollection) String() string { + return common.PointerString(m) +} + +// 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 (m CertificateCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/goldengate/certificate_lifecycle_state.go b/goldengate/certificate_lifecycle_state.go new file mode 100644 index 0000000000..21e570281b --- /dev/null +++ b/goldengate/certificate_lifecycle_state.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// GoldenGate API +// +// Use the Oracle Cloud Infrastructure GoldenGate APIs to perform data replication operations. +// + +package goldengate + +import ( + "strings" +) + +// CertificateLifecycleStateEnum Enum with underlying type: string +type CertificateLifecycleStateEnum string + +// Set of constants representing the allowable values for CertificateLifecycleStateEnum +const ( + CertificateLifecycleStateCreating CertificateLifecycleStateEnum = "CREATING" + CertificateLifecycleStateActive CertificateLifecycleStateEnum = "ACTIVE" + CertificateLifecycleStateDeleting CertificateLifecycleStateEnum = "DELETING" + CertificateLifecycleStateDeleted CertificateLifecycleStateEnum = "DELETED" + CertificateLifecycleStateFailed CertificateLifecycleStateEnum = "FAILED" +) + +var mappingCertificateLifecycleStateEnum = map[string]CertificateLifecycleStateEnum{ + "CREATING": CertificateLifecycleStateCreating, + "ACTIVE": CertificateLifecycleStateActive, + "DELETING": CertificateLifecycleStateDeleting, + "DELETED": CertificateLifecycleStateDeleted, + "FAILED": CertificateLifecycleStateFailed, +} + +var mappingCertificateLifecycleStateEnumLowerCase = map[string]CertificateLifecycleStateEnum{ + "creating": CertificateLifecycleStateCreating, + "active": CertificateLifecycleStateActive, + "deleting": CertificateLifecycleStateDeleting, + "deleted": CertificateLifecycleStateDeleted, + "failed": CertificateLifecycleStateFailed, +} + +// GetCertificateLifecycleStateEnumValues Enumerates the set of values for CertificateLifecycleStateEnum +func GetCertificateLifecycleStateEnumValues() []CertificateLifecycleStateEnum { + values := make([]CertificateLifecycleStateEnum, 0) + for _, v := range mappingCertificateLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetCertificateLifecycleStateEnumStringValues Enumerates the set of values in String for CertificateLifecycleStateEnum +func GetCertificateLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingCertificateLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCertificateLifecycleStateEnum(val string) (CertificateLifecycleStateEnum, bool) { + enum, ok := mappingCertificateLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/goldengate/certificate_summary.go b/goldengate/certificate_summary.go new file mode 100644 index 0000000000..73a08db151 --- /dev/null +++ b/goldengate/certificate_summary.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// GoldenGate API +// +// Use the Oracle Cloud Infrastructure GoldenGate APIs to perform data replication operations. +// + +package goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CertificateSummary Summary of the Certificates. +type CertificateSummary struct { + + // The identifier key (unique name in the scope of the deployment) of the certificate being referenced. + // It must be 1 to 32 characters long, must contain only alphanumeric characters and must start with a letter. + Key *string `mandatory:"true" json:"key"` + + // Possible certificate lifecycle states. + LifecycleState CertificateLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The Certificate subject. + Subject *string `mandatory:"true" json:"subject"` + + // Indicates if the certificate is self signed. + IsSelfSigned *bool `mandatory:"true" json:"isSelfSigned"` + + // The time the certificate is valid to. The format is defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`. + TimeValidTo *common.SDKTime `mandatory:"true" json:"timeValidTo"` + + // The time the resource was created. The format is defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` +} + +func (m CertificateSummary) String() string { + return common.PointerString(m) +} + +// 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 (m CertificateSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCertificateLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCertificateLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/goldengate/create_certificate_details.go b/goldengate/create_certificate_details.go new file mode 100644 index 0000000000..ffac912a11 --- /dev/null +++ b/goldengate/create_certificate_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// GoldenGate API +// +// Use the Oracle Cloud Infrastructure GoldenGate APIs to perform data replication operations. +// + +package goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateCertificateDetails The information about a new Certificates. +type CreateCertificateDetails struct { + + // The identifier key (unique name in the scope of the deployment) of the certificate being referenced. + // It must be 1 to 32 characters long, must contain only alphanumeric characters and must start with a letter. + Key *string `mandatory:"true" json:"key"` + + // A PEM-encoded SSL certificate. + CertificateContent *string `mandatory:"true" json:"certificateContent"` +} + +func (m CreateCertificateDetails) String() string { + return common.PointerString(m) +} + +// 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 (m CreateCertificateDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/goldengate/create_certificate_request_response.go b/goldengate/create_certificate_request_response.go new file mode 100644 index 0000000000..aeb7148828 --- /dev/null +++ b/goldengate/create_certificate_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, 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 goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateCertificateRequest wrapper for the CreateCertificate operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/CreateCertificate.go.html to see an example of how to use CreateCertificateRequest. +type CreateCertificateRequest struct { + + // Specifications to create the certificate to truststore. + CreateCertificateDetails `contributesTo:"body"` + + // A unique Deployment identifier. + DeploymentId *string `mandatory:"true" contributesTo:"path" name:"deploymentId"` + + // A token that uniquely identifies a request so it can be retried, in case of a timeout or server error, + // without the 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 was deleted and purged + // from the system, then a retry of the original creation request is rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 CreateCertificateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateCertificateRequest) 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 CreateCertificateRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCertificateRequest) 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 CreateCertificateRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateCertificateResponse wrapper for the CreateCertificate operation +type CreateCertificateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for an asynchronous request. You can use this to query + // status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please include the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateCertificateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateCertificateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/goldengate/create_microsoft_sqlserver_connection_details.go b/goldengate/create_microsoft_sqlserver_connection_details.go index 46aa635cde..38a4c87f17 100644 --- a/goldengate/create_microsoft_sqlserver_connection_details.go +++ b/goldengate/create_microsoft_sqlserver_connection_details.go @@ -72,7 +72,7 @@ type CreateMicrosoftSqlserverConnectionDetails struct { // Used as additional parameters in connection string. AdditionalAttributes []NameValuePair `mandatory:"false" json:"additionalAttributes"` - // Database Certificate - The base64 encoded content of pem file + // Database Certificate - The base64 encoded content of a .pem or .crt file. // containing the server public key (for 1-way SSL). SslCa *string `mandatory:"false" json:"sslCa"` diff --git a/goldengate/create_mysql_connection_details.go b/goldengate/create_mysql_connection_details.go index 4175d6502b..2bd7aaed61 100644 --- a/goldengate/create_mysql_connection_details.go +++ b/goldengate/create_mysql_connection_details.go @@ -70,20 +70,19 @@ type CreateMysqlConnectionDetails struct { // The port of an endpoint usually specified for a connection. Port *int `mandatory:"false" json:"port"` - // Database Certificate - The base64 encoded content of mysql.pem file + // Database Certificate - The base64 encoded content of a .pem or .crt file. // containing the server public key (for 1 and 2-way SSL). SslCa *string `mandatory:"false" json:"sslCa"` - // Certificates revoked by certificate authorities (CA). - // Server certificate must not be on this list (for 1 and 2-way SSL). - // Note: This is an optional and that too only applicable if TLS/MTLS option is selected. + // The base64 encoded list of certificates revoked by the trusted certificate authorities (Trusted CA). + // Note: This is an optional property and only applicable if TLS/MTLS option is selected. SslCrl *string `mandatory:"false" json:"sslCrl"` - // Client Certificate - The base64 encoded content of client-cert.pem file + // Client Certificate - The base64 encoded content of a .pem or .crt file. // containing the client public key (for 2-way SSL). SslCert *string `mandatory:"false" json:"sslCert"` - // Client Key - The client-key.pem containing the client private key (for 2-way SSL). + // Client Key – The base64 encoded content of a .pem or .crt file containing the client private key (for 2-way SSL). SslKey *string `mandatory:"false" json:"sslKey"` // The private IP address of the connection's endpoint in the customer's VCN, typically a diff --git a/goldengate/create_postgresql_connection_details.go b/goldengate/create_postgresql_connection_details.go index f9c38352d8..192020b3ce 100644 --- a/goldengate/create_postgresql_connection_details.go +++ b/goldengate/create_postgresql_connection_details.go @@ -75,15 +75,16 @@ type CreatePostgresqlConnectionDetails struct { AdditionalAttributes []NameValuePair `mandatory:"false" json:"additionalAttributes"` // The base64 encoded certificate of the trusted certificate authorities (Trusted CA) for PostgreSQL. + // The supported file formats are .pem and .crt. SslCa *string `mandatory:"false" json:"sslCa"` - // The base64 encoded list of certificates revoked by the trusted certificate authorities (Trusted CA) for PostgreSQL. + // The base64 encoded list of certificates revoked by the trusted certificate authorities (Trusted CA). SslCrl *string `mandatory:"false" json:"sslCrl"` - // The base64 encoded certificate of the PostgreSQL server. + // The base64 encoded certificate of the PostgreSQL server. The supported file formats are .pem and .crt. SslCert *string `mandatory:"false" json:"sslCert"` - // The base64 encoded private key of the PostgreSQL server. + // The base64 encoded private key of the PostgreSQL server. The supported file formats are .pem and .crt. SslKey *string `mandatory:"false" json:"sslKey"` // The private IP address of the connection's endpoint in the customer's VCN, typically a diff --git a/goldengate/delete_certificate_request_response.go b/goldengate/delete_certificate_request_response.go new file mode 100644 index 0000000000..bda60e813d --- /dev/null +++ b/goldengate/delete_certificate_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, 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 goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteCertificateRequest wrapper for the DeleteCertificate operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/DeleteCertificate.go.html to see an example of how to use DeleteCertificateRequest. +type DeleteCertificateRequest struct { + + // A unique Deployment identifier. + DeploymentId *string `mandatory:"true" contributesTo:"path" name:"deploymentId"` + + // A unique certificate identifier. + CertificateKey *string `mandatory:"true" contributesTo:"path" name:"certificateKey"` + + // 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 is 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"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteCertificateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteCertificateRequest) 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 DeleteCertificateRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCertificateRequest) 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 DeleteCertificateRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteCertificateResponse wrapper for the DeleteCertificate operation +type DeleteCertificateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for an asynchronous request. You can use this to query + // status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please include the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteCertificateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCertificateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/goldengate/get_certificate_request_response.go b/goldengate/get_certificate_request_response.go new file mode 100644 index 0000000000..2c3fcc6cb4 --- /dev/null +++ b/goldengate/get_certificate_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, 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 goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCertificateRequest wrapper for the GetCertificate operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/GetCertificate.go.html to see an example of how to use GetCertificateRequest. +type GetCertificateRequest struct { + + // A unique Deployment identifier. + DeploymentId *string `mandatory:"true" contributesTo:"path" name:"deploymentId"` + + // A unique certificate identifier. + CertificateKey *string `mandatory:"true" contributesTo:"path" name:"certificateKey"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetCertificateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCertificateRequest) 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 GetCertificateRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCertificateRequest) 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 GetCertificateRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCertificateResponse wrapper for the GetCertificate operation +type GetCertificateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Certificate instance + Certificate `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please include the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetCertificateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCertificateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/goldengate/goldengate_client.go b/goldengate/goldengate_client.go index 9e8d596228..6edba776af 100644 --- a/goldengate/goldengate_client.go +++ b/goldengate/goldengate_client.go @@ -666,6 +666,69 @@ func (client GoldenGateClient) copyDeploymentBackup(ctx context.Context, request return response, err } +// CreateCertificate Creates a new certificate to truststore. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/CreateCertificate.go.html to see an example of how to use CreateCertificate API. +// A default retry strategy applies to this operation CreateCertificate() +func (client GoldenGateClient) CreateCertificate(ctx context.Context, request CreateCertificateRequest) (response CreateCertificateResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.createCertificate, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateCertificateResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateCertificateResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateCertificateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCertificateResponse") + } + return +} + +// createCertificate implements the OCIOperation interface (enables retrying operations) +func (client GoldenGateClient) createCertificate(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/deployments/{deploymentId}/certificates", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateCertificateResponse + 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/goldengate/20200407/CertificateCollection/CreateCertificate" + err = common.PostProcessServiceError(err, "GoldenGate", "CreateCertificate", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateConnection Creates a new Connection. // // # See also @@ -982,6 +1045,64 @@ func (client GoldenGateClient) createDeploymentBackup(ctx context.Context, reque return response, err } +// DeleteCertificate Deletes the certificate from truststore. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/DeleteCertificate.go.html to see an example of how to use DeleteCertificate API. +// A default retry strategy applies to this operation DeleteCertificate() +func (client GoldenGateClient) DeleteCertificate(ctx context.Context, request DeleteCertificateRequest) (response DeleteCertificateResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteCertificate, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteCertificateResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteCertificateResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteCertificateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCertificateResponse") + } + return +} + +// deleteCertificate implements the OCIOperation interface (enables retrying operations) +func (client GoldenGateClient) deleteCertificate(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/deployments/{deploymentId}/certificates/{certificateKey}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteCertificateResponse + 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/goldengate/20200407/Certificate/DeleteCertificate" + err = common.PostProcessServiceError(err, "GoldenGate", "DeleteCertificate", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteConnection Deletes a Connection. // // # See also @@ -1399,6 +1520,64 @@ func (client GoldenGateClient) exportDeploymentWallet(ctx context.Context, reque return response, err } +// GetCertificate Retrieves a Certificate. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/GetCertificate.go.html to see an example of how to use GetCertificate API. +// A default retry strategy applies to this operation GetCertificate() +func (client GoldenGateClient) GetCertificate(ctx context.Context, request GetCertificateRequest) (response GetCertificateResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCertificate, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCertificateResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCertificateResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCertificateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCertificateResponse") + } + return +} + +// getCertificate implements the OCIOperation interface (enables retrying operations) +func (client GoldenGateClient) getCertificate(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/deployments/{deploymentId}/certificates/{certificateKey}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCertificateResponse + 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/goldengate/20200407/Certificate/GetCertificate" + err = common.PostProcessServiceError(err, "GoldenGate", "GetCertificate", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetConnection Retrieves a Connection. // // # See also @@ -1869,6 +2048,64 @@ func (client GoldenGateClient) importDeploymentWallet(ctx context.Context, reque return response, err } +// ListCertificates Returns a list of certificates from truststore. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/ListCertificates.go.html to see an example of how to use ListCertificates API. +// A default retry strategy applies to this operation ListCertificates() +func (client GoldenGateClient) ListCertificates(ctx context.Context, request ListCertificatesRequest) (response ListCertificatesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCertificates, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListCertificatesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListCertificatesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListCertificatesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCertificatesResponse") + } + return +} + +// listCertificates implements the OCIOperation interface (enables retrying operations) +func (client GoldenGateClient) listCertificates(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/deployments/{deploymentId}/certificates", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListCertificatesResponse + 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/goldengate/20200407/CertificateCollection/ListCertificates" + err = common.PostProcessServiceError(err, "GoldenGate", "ListCertificates", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListConnectionAssignments Lists the Connection Assignments in the compartment. // // # See also diff --git a/goldengate/list_certificates_request_response.go b/goldengate/list_certificates_request_response.go new file mode 100644 index 0000000000..639484cef3 --- /dev/null +++ b/goldengate/list_certificates_request_response.go @@ -0,0 +1,259 @@ +// Copyright (c) 2016, 2018, 2023, 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 goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListCertificatesRequest wrapper for the ListCertificates operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/ListCertificates.go.html to see an example of how to use ListCertificatesRequest. +type ListCertificatesRequest struct { + + // A unique Deployment identifier. + DeploymentId *string `mandatory:"true" contributesTo:"path" name:"deploymentId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only connections having the 'lifecycleState' given. + LifecycleState ListCertificatesLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually + // retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListCertificatesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order can be provided. Default order for 'timeCreated' is + // descending. Default order for 'displayName' is ascending. If no value is specified + // timeCreated is the default. + SortBy ListCertificatesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // 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 ListCertificatesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCertificatesRequest) 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 ListCertificatesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCertificatesRequest) 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 ListCertificatesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListCertificatesLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetListCertificatesLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListCertificatesSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListCertificatesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListCertificatesSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListCertificatesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListCertificatesResponse wrapper for the ListCertificates operation +type ListCertificatesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of CertificateCollection instances + CertificateCollection `presentIn:"body"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please include the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The page token represents the page to start retrieving results. This is usually retrieved + // from a previous list call. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListCertificatesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCertificatesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCertificatesLifecycleStateEnum Enum with underlying type: string +type ListCertificatesLifecycleStateEnum string + +// Set of constants representing the allowable values for ListCertificatesLifecycleStateEnum +const ( + ListCertificatesLifecycleStateCreating ListCertificatesLifecycleStateEnum = "CREATING" + ListCertificatesLifecycleStateActive ListCertificatesLifecycleStateEnum = "ACTIVE" + ListCertificatesLifecycleStateDeleting ListCertificatesLifecycleStateEnum = "DELETING" + ListCertificatesLifecycleStateDeleted ListCertificatesLifecycleStateEnum = "DELETED" + ListCertificatesLifecycleStateFailed ListCertificatesLifecycleStateEnum = "FAILED" +) + +var mappingListCertificatesLifecycleStateEnum = map[string]ListCertificatesLifecycleStateEnum{ + "CREATING": ListCertificatesLifecycleStateCreating, + "ACTIVE": ListCertificatesLifecycleStateActive, + "DELETING": ListCertificatesLifecycleStateDeleting, + "DELETED": ListCertificatesLifecycleStateDeleted, + "FAILED": ListCertificatesLifecycleStateFailed, +} + +var mappingListCertificatesLifecycleStateEnumLowerCase = map[string]ListCertificatesLifecycleStateEnum{ + "creating": ListCertificatesLifecycleStateCreating, + "active": ListCertificatesLifecycleStateActive, + "deleting": ListCertificatesLifecycleStateDeleting, + "deleted": ListCertificatesLifecycleStateDeleted, + "failed": ListCertificatesLifecycleStateFailed, +} + +// GetListCertificatesLifecycleStateEnumValues Enumerates the set of values for ListCertificatesLifecycleStateEnum +func GetListCertificatesLifecycleStateEnumValues() []ListCertificatesLifecycleStateEnum { + values := make([]ListCertificatesLifecycleStateEnum, 0) + for _, v := range mappingListCertificatesLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListCertificatesLifecycleStateEnumStringValues Enumerates the set of values in String for ListCertificatesLifecycleStateEnum +func GetListCertificatesLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingListCertificatesLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCertificatesLifecycleStateEnum(val string) (ListCertificatesLifecycleStateEnum, bool) { + enum, ok := mappingListCertificatesLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCertificatesSortOrderEnum Enum with underlying type: string +type ListCertificatesSortOrderEnum string + +// Set of constants representing the allowable values for ListCertificatesSortOrderEnum +const ( + ListCertificatesSortOrderAsc ListCertificatesSortOrderEnum = "ASC" + ListCertificatesSortOrderDesc ListCertificatesSortOrderEnum = "DESC" +) + +var mappingListCertificatesSortOrderEnum = map[string]ListCertificatesSortOrderEnum{ + "ASC": ListCertificatesSortOrderAsc, + "DESC": ListCertificatesSortOrderDesc, +} + +var mappingListCertificatesSortOrderEnumLowerCase = map[string]ListCertificatesSortOrderEnum{ + "asc": ListCertificatesSortOrderAsc, + "desc": ListCertificatesSortOrderDesc, +} + +// GetListCertificatesSortOrderEnumValues Enumerates the set of values for ListCertificatesSortOrderEnum +func GetListCertificatesSortOrderEnumValues() []ListCertificatesSortOrderEnum { + values := make([]ListCertificatesSortOrderEnum, 0) + for _, v := range mappingListCertificatesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListCertificatesSortOrderEnumStringValues Enumerates the set of values in String for ListCertificatesSortOrderEnum +func GetListCertificatesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListCertificatesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCertificatesSortOrderEnum(val string) (ListCertificatesSortOrderEnum, bool) { + enum, ok := mappingListCertificatesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCertificatesSortByEnum Enum with underlying type: string +type ListCertificatesSortByEnum string + +// Set of constants representing the allowable values for ListCertificatesSortByEnum +const ( + ListCertificatesSortByTimecreated ListCertificatesSortByEnum = "timeCreated" + ListCertificatesSortByDisplayname ListCertificatesSortByEnum = "displayName" +) + +var mappingListCertificatesSortByEnum = map[string]ListCertificatesSortByEnum{ + "timeCreated": ListCertificatesSortByTimecreated, + "displayName": ListCertificatesSortByDisplayname, +} + +var mappingListCertificatesSortByEnumLowerCase = map[string]ListCertificatesSortByEnum{ + "timecreated": ListCertificatesSortByTimecreated, + "displayname": ListCertificatesSortByDisplayname, +} + +// GetListCertificatesSortByEnumValues Enumerates the set of values for ListCertificatesSortByEnum +func GetListCertificatesSortByEnumValues() []ListCertificatesSortByEnum { + values := make([]ListCertificatesSortByEnum, 0) + for _, v := range mappingListCertificatesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListCertificatesSortByEnumStringValues Enumerates the set of values in String for ListCertificatesSortByEnum +func GetListCertificatesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListCertificatesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCertificatesSortByEnum(val string) (ListCertificatesSortByEnum, bool) { + enum, ok := mappingListCertificatesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/goldengate/microsoft_sqlserver_connection.go b/goldengate/microsoft_sqlserver_connection.go index edc881d23a..2508f1647f 100644 --- a/goldengate/microsoft_sqlserver_connection.go +++ b/goldengate/microsoft_sqlserver_connection.go @@ -95,7 +95,7 @@ type MicrosoftSqlserverConnection struct { // Used as additional parameters in connection string. AdditionalAttributes []NameValuePair `mandatory:"false" json:"additionalAttributes"` - // Database Certificate - The base64 encoded content of pem file + // Database Certificate - The base64 encoded content of a .pem or .crt file. // containing the server public key (for 1-way SSL). SslCa *string `mandatory:"false" json:"sslCa"` diff --git a/goldengate/microsoft_sqlserver_connection_summary.go b/goldengate/microsoft_sqlserver_connection_summary.go index f692bb3038..56973c3c81 100644 --- a/goldengate/microsoft_sqlserver_connection_summary.go +++ b/goldengate/microsoft_sqlserver_connection_summary.go @@ -95,7 +95,7 @@ type MicrosoftSqlserverConnectionSummary struct { // Used as additional parameters in connection string. AdditionalAttributes []NameValuePair `mandatory:"false" json:"additionalAttributes"` - // Database Certificate - The base64 encoded content of pem file + // Database Certificate - The base64 encoded content of a .pem or .crt file. // containing the server public key (for 1-way SSL). SslCa *string `mandatory:"false" json:"sslCa"` diff --git a/goldengate/operation_type.go b/goldengate/operation_type.go index e146421af9..df563bdbd9 100644 --- a/goldengate/operation_type.go +++ b/goldengate/operation_type.go @@ -46,6 +46,8 @@ const ( OperationTypeGoldengateDeploymentUpgradeUpgrade OperationTypeEnum = "GOLDENGATE_DEPLOYMENT_UPGRADE_UPGRADE" OperationTypeGoldengateDeploymentUpgradeRollback OperationTypeEnum = "GOLDENGATE_DEPLOYMENT_UPGRADE_ROLLBACK" OperationTypeGoldengateDeploymentUpgradeSnooze OperationTypeEnum = "GOLDENGATE_DEPLOYMENT_UPGRADE_SNOOZE" + OperationTypeGoldengateDeploymentCertificateCreate OperationTypeEnum = "GOLDENGATE_DEPLOYMENT_CERTIFICATE_CREATE" + OperationTypeGoldengateDeploymentCertificateDelete OperationTypeEnum = "GOLDENGATE_DEPLOYMENT_CERTIFICATE_DELETE" ) var mappingOperationTypeEnum = map[string]OperationTypeEnum{ @@ -77,6 +79,8 @@ var mappingOperationTypeEnum = map[string]OperationTypeEnum{ "GOLDENGATE_DEPLOYMENT_UPGRADE_UPGRADE": OperationTypeGoldengateDeploymentUpgradeUpgrade, "GOLDENGATE_DEPLOYMENT_UPGRADE_ROLLBACK": OperationTypeGoldengateDeploymentUpgradeRollback, "GOLDENGATE_DEPLOYMENT_UPGRADE_SNOOZE": OperationTypeGoldengateDeploymentUpgradeSnooze, + "GOLDENGATE_DEPLOYMENT_CERTIFICATE_CREATE": OperationTypeGoldengateDeploymentCertificateCreate, + "GOLDENGATE_DEPLOYMENT_CERTIFICATE_DELETE": OperationTypeGoldengateDeploymentCertificateDelete, } var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ @@ -108,6 +112,8 @@ var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ "goldengate_deployment_upgrade_upgrade": OperationTypeGoldengateDeploymentUpgradeUpgrade, "goldengate_deployment_upgrade_rollback": OperationTypeGoldengateDeploymentUpgradeRollback, "goldengate_deployment_upgrade_snooze": OperationTypeGoldengateDeploymentUpgradeSnooze, + "goldengate_deployment_certificate_create": OperationTypeGoldengateDeploymentCertificateCreate, + "goldengate_deployment_certificate_delete": OperationTypeGoldengateDeploymentCertificateDelete, } // GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum @@ -150,6 +156,8 @@ func GetOperationTypeEnumStringValues() []string { "GOLDENGATE_DEPLOYMENT_UPGRADE_UPGRADE", "GOLDENGATE_DEPLOYMENT_UPGRADE_ROLLBACK", "GOLDENGATE_DEPLOYMENT_UPGRADE_SNOOZE", + "GOLDENGATE_DEPLOYMENT_CERTIFICATE_CREATE", + "GOLDENGATE_DEPLOYMENT_CERTIFICATE_DELETE", } } diff --git a/goldengate/update_microsoft_sqlserver_connection_details.go b/goldengate/update_microsoft_sqlserver_connection_details.go index 40fdcee909..4ca3c78d8a 100644 --- a/goldengate/update_microsoft_sqlserver_connection_details.go +++ b/goldengate/update_microsoft_sqlserver_connection_details.go @@ -66,7 +66,7 @@ type UpdateMicrosoftSqlserverConnectionDetails struct { // Used as additional parameters in connection string. AdditionalAttributes []NameValuePair `mandatory:"false" json:"additionalAttributes"` - // Database Certificate - The base64 encoded content of pem file + // Database Certificate - The base64 encoded content of a .pem or .crt file. // containing the server public key (for 1-way SSL). SslCa *string `mandatory:"false" json:"sslCa"` diff --git a/goldengate/update_mysql_connection_details.go b/goldengate/update_mysql_connection_details.go index 4488ccb565..a875d1ab8c 100644 --- a/goldengate/update_mysql_connection_details.go +++ b/goldengate/update_mysql_connection_details.go @@ -64,20 +64,19 @@ type UpdateMysqlConnectionDetails struct { // The name of the database. DatabaseName *string `mandatory:"false" json:"databaseName"` - // Database Certificate - The base64 encoded content of mysql.pem file + // Database Certificate - The base64 encoded content of a .pem or .crt file. // containing the server public key (for 1 and 2-way SSL). SslCa *string `mandatory:"false" json:"sslCa"` - // Certificates revoked by certificate authorities (CA). - // Server certificate must not be on this list (for 1 and 2-way SSL). - // Note: This is an optional and that too only applicable if TLS/MTLS option is selected. + // The base64 encoded list of certificates revoked by the trusted certificate authorities (Trusted CA). + // Note: This is an optional property and only applicable if TLS/MTLS option is selected. SslCrl *string `mandatory:"false" json:"sslCrl"` - // Client Certificate - The base64 encoded content of client-cert.pem file + // Client Certificate - The base64 encoded content of a .pem or .crt file. // containing the client public key (for 2-way SSL). SslCert *string `mandatory:"false" json:"sslCert"` - // Client Key - The client-key.pem containing the client private key (for 2-way SSL). + // Client Key – The base64 encoded content of a .pem or .crt file containing the client private key (for 2-way SSL). SslKey *string `mandatory:"false" json:"sslKey"` // The private IP address of the connection's endpoint in the customer's VCN, typically a diff --git a/goldengate/update_postgresql_connection_details.go b/goldengate/update_postgresql_connection_details.go index 9af85862d5..6cd6b2d281 100644 --- a/goldengate/update_postgresql_connection_details.go +++ b/goldengate/update_postgresql_connection_details.go @@ -69,15 +69,16 @@ type UpdatePostgresqlConnectionDetails struct { AdditionalAttributes []NameValuePair `mandatory:"false" json:"additionalAttributes"` // The base64 encoded certificate of the trusted certificate authorities (Trusted CA) for PostgreSQL. + // The supported file formats are .pem and .crt. SslCa *string `mandatory:"false" json:"sslCa"` - // The base64 encoded list of certificates revoked by the trusted certificate authorities (Trusted CA) for PostgreSQL. + // The base64 encoded list of certificates revoked by the trusted certificate authorities (Trusted CA). SslCrl *string `mandatory:"false" json:"sslCrl"` - // The base64 encoded certificate of the PostgreSQL server. + // The base64 encoded certificate of the PostgreSQL server. The supported file formats are .pem and .crt. SslCert *string `mandatory:"false" json:"sslCert"` - // The base64 encoded private key of the PostgreSQL server. + // The base64 encoded private key of the PostgreSQL server. The supported file formats are .pem and .crt. SslKey *string `mandatory:"false" json:"sslKey"` // The private IP address of the connection's endpoint in the customer's VCN, typically a diff --git a/loganalytics/export_details.go b/loganalytics/export_details.go index 1ecf6c72ae..96bb5983fe 100644 --- a/loganalytics/export_details.go +++ b/loganalytics/export_details.go @@ -33,13 +33,13 @@ type ExportDetails struct { // List of filters to be applied when the query executes. More than one filter per field is not permitted. ScopeFilters []ScopeFilter `mandatory:"false" json:"scopeFilters"` - // Maximum number of results retrieved from data source. Note a maximum value will be enforced; if the export results can be streamed, the maximum will be 50000000, otherwise 10000; that is, if not streamed, actualMaxTotalCountUsed = Math.min(maxTotalCount, 10000). - // - // Export will incrementally stream results depending on the queryString. - // Some commands including head/tail are not compatible with streaming result delivery and therefore enforce a reduced limit on overall maxtotalcount. - // no sort command or sort by id, e.g. ' | sort id ' - is streaming compatible - // sort by time and id, e.g. ' | sort -time, id ' - is streaming compatible - // all other cases, e.g. ' | sort -time, id, mtgtguid ' - is not streaming compatible due to the additional sort field + // Maximum number of results retrieved from data source is determined by the specific query used and the maxTotalCount input field. + // If the export results can be streamed, the maximum will be 1,000,000. + // If the results cannot be streamed, the maximum limit is 500 for queries that include the link command + // and 10,000 for the queries that does not include the link command. + // Queries that include certain commands such as head, tail or stats cannot be streamed and are subject to a maximum of 10,000 results. + // Queries that include the sort command cannot be streamed unless the sort fields are restricted to id and/or time. + // The maximum number of results retrieved is the lesser of the maxTotalCount input provided and the applicable limit described above. MaxTotalCount *int `mandatory:"false" json:"maxTotalCount"` TimeFilter *TimeRange `mandatory:"false" json:"timeFilter"` diff --git a/loganalytics/loganalytics_client.go b/loganalytics/loganalytics_client.go index b932d817d5..783669791f 100644 --- a/loganalytics/loganalytics_client.go +++ b/loganalytics/loganalytics_client.go @@ -10694,6 +10694,81 @@ func (client LogAnalyticsClient) updateStorage(ctx context.Context, request comm return response, err } +// UploadDiscoveryData Accepts discovery data for processing by Logging Analytics. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/UploadDiscoveryData.go.html to see an example of how to use UploadDiscoveryData API. +// A default retry strategy applies to this operation UploadDiscoveryData() +func (client LogAnalyticsClient) UploadDiscoveryData(ctx context.Context, request UploadDiscoveryDataRequest) (response UploadDiscoveryDataResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.uploadDiscoveryData, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UploadDiscoveryDataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UploadDiscoveryDataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UploadDiscoveryDataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UploadDiscoveryDataResponse") + } + return +} + +// uploadDiscoveryData implements the OCIOperation interface (enables retrying operations) +func (client LogAnalyticsClient) uploadDiscoveryData(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + if !common.IsEnvVarFalse(common.UsingExpectHeaderEnvVar) { + extraHeaders["Expect"] = "100-continue" + } + httpRequest, err := request.HTTPRequest(http.MethodPost, "/namespaces/{namespaceName}/actions/uploadDiscoveryData", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UploadDiscoveryDataResponse + var httpResponse *http.Response + var customSigner common.HTTPRequestSigner + excludeBodySigningPredicate := func(r *http.Request) bool { return false } + customSigner, err = common.NewSignerFromOCIRequestSigner(client.Signer, excludeBodySigningPredicate) + + //if there was an error overriding the signer, then use the signer from the client itself + if err != nil { + customSigner = client.Signer + } + + //Execute the request with a custom signer + httpResponse, err = client.CallWithDetails(ctx, &httpRequest, common.ClientCallDetails{Signer: customSigner}) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/logan-api-spec/20200601/LogAnalyticsEntity/UploadDiscoveryData" + err = common.PostProcessServiceError(err, "LogAnalytics", "UploadDiscoveryData", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UploadLogEventsFile Accepts log events for processing by Logging Analytics. // // # See also diff --git a/loganalytics/upload_discovery_data_request_response.go b/loganalytics/upload_discovery_data_request_response.go new file mode 100644 index 0000000000..5fc9025e1c --- /dev/null +++ b/loganalytics/upload_discovery_data_request_response.go @@ -0,0 +1,216 @@ +// Copyright (c) 2016, 2018, 2023, 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 loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// UploadDiscoveryDataRequest wrapper for the UploadDiscoveryData operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/UploadDiscoveryData.go.html to see an example of how to use UploadDiscoveryDataRequest. +type UploadDiscoveryDataRequest struct { + + // The Logging Analytics namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // Discovery data + UploadDiscoveryDataDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata key and value pairs separated by a semicolon. Example k1:v1;k2:v2;k3:v3 + OpcMetaProperties *string `mandatory:"false" contributesTo:"header" name:"opc-meta-properties"` + + // Discovery data type + DiscoveryDataType UploadDiscoveryDataDiscoveryDataTypeEnum `mandatory:"false" contributesTo:"query" name:"discoveryDataType" omitEmpty:"true"` + + // Identifies the type of request payload. + PayloadType UploadDiscoveryDataPayloadTypeEnum `mandatory:"false" contributesTo:"query" name:"payloadType" omitEmpty:"true"` + + // The content type of the log data. + ContentType *string `mandatory:"false" contributesTo:"header" name:"content-type"` + + // 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 + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // A value of `100-continue` requests preliminary verification of the request method, path, and headers before the request body is sent. + // If no error results from such verification, the server will send a 100 (Continue) interim response to indicate readiness for the request body. + // The only allowed value for this parameter is "100-Continue" (case-insensitive). + Expect *string `mandatory:"false" contributesTo:"header" name:"expect"` + + // 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 UploadDiscoveryDataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UploadDiscoveryDataRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UploadDiscoveryDataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.UploadDiscoveryDataDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UploadDiscoveryDataRequest) 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 UploadDiscoveryDataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingUploadDiscoveryDataDiscoveryDataTypeEnum(string(request.DiscoveryDataType)); !ok && request.DiscoveryDataType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DiscoveryDataType: %s. Supported values are: %s.", request.DiscoveryDataType, strings.Join(GetUploadDiscoveryDataDiscoveryDataTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingUploadDiscoveryDataPayloadTypeEnum(string(request.PayloadType)); !ok && request.PayloadType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PayloadType: %s. Supported values are: %s.", request.PayloadType, strings.Join(GetUploadDiscoveryDataPayloadTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UploadDiscoveryDataResponse wrapper for the UploadDiscoveryData operation +type UploadDiscoveryDataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. When you contact Oracle about a specific request, provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for log data. + OpcObjectId *string `presentIn:"header" name:"opc-object-id"` + + // The time the upload was created, in the format defined by RFC3339 + TimeCreated *common.SDKTime `presentIn:"header" name:"timecreated"` +} + +func (response UploadDiscoveryDataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UploadDiscoveryDataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// UploadDiscoveryDataDiscoveryDataTypeEnum Enum with underlying type: string +type UploadDiscoveryDataDiscoveryDataTypeEnum string + +// Set of constants representing the allowable values for UploadDiscoveryDataDiscoveryDataTypeEnum +const ( + UploadDiscoveryDataDiscoveryDataTypeEntity UploadDiscoveryDataDiscoveryDataTypeEnum = "ENTITY" + UploadDiscoveryDataDiscoveryDataTypeK8sObjects UploadDiscoveryDataDiscoveryDataTypeEnum = "K8S_OBJECTS" +) + +var mappingUploadDiscoveryDataDiscoveryDataTypeEnum = map[string]UploadDiscoveryDataDiscoveryDataTypeEnum{ + "ENTITY": UploadDiscoveryDataDiscoveryDataTypeEntity, + "K8S_OBJECTS": UploadDiscoveryDataDiscoveryDataTypeK8sObjects, +} + +var mappingUploadDiscoveryDataDiscoveryDataTypeEnumLowerCase = map[string]UploadDiscoveryDataDiscoveryDataTypeEnum{ + "entity": UploadDiscoveryDataDiscoveryDataTypeEntity, + "k8s_objects": UploadDiscoveryDataDiscoveryDataTypeK8sObjects, +} + +// GetUploadDiscoveryDataDiscoveryDataTypeEnumValues Enumerates the set of values for UploadDiscoveryDataDiscoveryDataTypeEnum +func GetUploadDiscoveryDataDiscoveryDataTypeEnumValues() []UploadDiscoveryDataDiscoveryDataTypeEnum { + values := make([]UploadDiscoveryDataDiscoveryDataTypeEnum, 0) + for _, v := range mappingUploadDiscoveryDataDiscoveryDataTypeEnum { + values = append(values, v) + } + return values +} + +// GetUploadDiscoveryDataDiscoveryDataTypeEnumStringValues Enumerates the set of values in String for UploadDiscoveryDataDiscoveryDataTypeEnum +func GetUploadDiscoveryDataDiscoveryDataTypeEnumStringValues() []string { + return []string{ + "ENTITY", + "K8S_OBJECTS", + } +} + +// GetMappingUploadDiscoveryDataDiscoveryDataTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUploadDiscoveryDataDiscoveryDataTypeEnum(val string) (UploadDiscoveryDataDiscoveryDataTypeEnum, bool) { + enum, ok := mappingUploadDiscoveryDataDiscoveryDataTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// UploadDiscoveryDataPayloadTypeEnum Enum with underlying type: string +type UploadDiscoveryDataPayloadTypeEnum string + +// Set of constants representing the allowable values for UploadDiscoveryDataPayloadTypeEnum +const ( + UploadDiscoveryDataPayloadTypeJson UploadDiscoveryDataPayloadTypeEnum = "JSON" + UploadDiscoveryDataPayloadTypeGzip UploadDiscoveryDataPayloadTypeEnum = "GZIP" + UploadDiscoveryDataPayloadTypeZip UploadDiscoveryDataPayloadTypeEnum = "ZIP" +) + +var mappingUploadDiscoveryDataPayloadTypeEnum = map[string]UploadDiscoveryDataPayloadTypeEnum{ + "JSON": UploadDiscoveryDataPayloadTypeJson, + "GZIP": UploadDiscoveryDataPayloadTypeGzip, + "ZIP": UploadDiscoveryDataPayloadTypeZip, +} + +var mappingUploadDiscoveryDataPayloadTypeEnumLowerCase = map[string]UploadDiscoveryDataPayloadTypeEnum{ + "json": UploadDiscoveryDataPayloadTypeJson, + "gzip": UploadDiscoveryDataPayloadTypeGzip, + "zip": UploadDiscoveryDataPayloadTypeZip, +} + +// GetUploadDiscoveryDataPayloadTypeEnumValues Enumerates the set of values for UploadDiscoveryDataPayloadTypeEnum +func GetUploadDiscoveryDataPayloadTypeEnumValues() []UploadDiscoveryDataPayloadTypeEnum { + values := make([]UploadDiscoveryDataPayloadTypeEnum, 0) + for _, v := range mappingUploadDiscoveryDataPayloadTypeEnum { + values = append(values, v) + } + return values +} + +// GetUploadDiscoveryDataPayloadTypeEnumStringValues Enumerates the set of values in String for UploadDiscoveryDataPayloadTypeEnum +func GetUploadDiscoveryDataPayloadTypeEnumStringValues() []string { + return []string{ + "JSON", + "GZIP", + "ZIP", + } +} + +// GetMappingUploadDiscoveryDataPayloadTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUploadDiscoveryDataPayloadTypeEnum(val string) (UploadDiscoveryDataPayloadTypeEnum, bool) { + enum, ok := mappingUploadDiscoveryDataPayloadTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/ocvp/cluster.go b/ocvp/cluster.go new file mode 100644 index 0000000000..6ebd7d73ef --- /dev/null +++ b/ocvp/cluster.go @@ -0,0 +1,168 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Cluster An Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm) Cluster contains the resources required for a +// functional VMware environment. Instances in a Cluster +// (see EsxiHost) run in a virtual cloud network (VCN) +// and are preconfigured with VMware and storage. Use the vCenter utility to manage +// and deploy VMware virtual machines (VMs) in the Cluster. +// The Cluster uses a single management subnet for provisioning the Cluster. It also uses a +// set of VLANs for various components of the VMware environment (vSphere, vMotion, +// vSAN, and so on). See the Core Services API for information about VCN subnets and VLANs. +type Cluster struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster. + Id *string `mandatory:"true" json:"id"` + + // The availability domain the ESXi hosts are running in. For Multi-AD Cluster, it is `multi-AD`. + // Example: `Uocm:PHX-AD-1`, `multi-AD` + ComputeAvailabilityDomain *string `mandatory:"true" json:"computeAvailabilityDomain"` + + // A descriptive name for the Cluster. It must be unique, start with a letter, and contain only letters, digits, + // whitespaces, dashes and underscores. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // In general, this is a specific version of bundled VMware software supported by + // Oracle Cloud VMware Solution (see + // ListSupportedVmwareSoftwareVersions). + // This attribute is not guaranteed to reflect the version of + // software currently installed on the ESXi hosts in the Cluster. The purpose + // of this attribute is to show the version of software that the Oracle + // Cloud VMware Solution will install on any new ESXi hosts that you *add to this + // Cluster in the future* with CreateEsxiHost. + // Therefore, if you upgrade the existing ESXi hosts in the Cluster to use a newer + // version of bundled VMware software supported by the Oracle Cloud VMware Solution, you + // should use UpdateCluster to update the Cluster's + // `vmwareSoftwareVersion` with that new version. + VmwareSoftwareVersion *string `mandatory:"true" json:"vmwareSoftwareVersion"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that + // contains the Cluster. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC that the + // Cluster belongs to. + SddcId *string `mandatory:"true" json:"sddcId"` + + // The number of ESXi hosts in the Cluster. + EsxiHostsCount *int `mandatory:"true" json:"esxiHostsCount"` + + NetworkConfiguration *NetworkConfiguration `mandatory:"true" json:"networkConfiguration"` + + // The date and time the Cluster was created, in the format defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The initial compute shape of the Cluster's ESXi hosts. + // ListSupportedHostShapes. + InitialHostShapeName *string `mandatory:"true" json:"initialHostShapeName"` + + // vSphere Cluster types. + VsphereType VsphereTypesEnum `mandatory:"true" json:"vsphereType"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // A prefix used in the name of each ESXi host and Compute instance in the Cluster. + // If this isn't set, the Cluster's `displayName` is used as the prefix. + // For example, if the value is `MyCluster`, the ESXi hosts are named `MyCluster-1`, + // `MyCluster-2`, and so on. + InstanceDisplayNamePrefix *string `mandatory:"false" json:"instanceDisplayNamePrefix"` + + // In general, this is a specific version of bundled ESXi software supported by + // Oracle Cloud VMware Solution (see + // ListSupportedVmwareSoftwareVersions). + // This attribute is not guaranteed to reflect the version of + // software currently installed on the ESXi hosts in the SDDC. The purpose + // of this attribute is to show the version of software that the Oracle + // Cloud VMware Solution will install on any new ESXi hosts that you *add to this + // SDDC in the future* with CreateEsxiHost + // unless a different version is configured on the ESXi host level. + // Therefore, if you upgrade the existing ESXi hosts in the Cluster to use a newer + // version of bundled ESXi software supported by the Oracle Cloud VMware Solution, you + // should use UpdateCluster to update the Cluster's + // `esxiSoftwareVersion` with that new version. + EsxiSoftwareVersion *string `mandatory:"false" json:"esxiSoftwareVersion"` + + // The billing option selected during Cluster creation. + // ListSupportedCommitments. + InitialCommitment CommitmentEnum `mandatory:"false" json:"initialCommitment,omitempty"` + + // The CIDR block for the IP addresses that VMware VMs in the SDDC use to run application + // workloads. + WorkloadNetworkCidr *string `mandatory:"false" json:"workloadNetworkCidr"` + + // The date and time the Cluster was updated, in the format defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The current state of the Cluster. + LifecycleState LifecycleStatesEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The vSphere licenses to use when upgrading the Cluster. + UpgradeLicenses []VsphereLicense `mandatory:"false" json:"upgradeLicenses"` + + // The links to binary objects needed to upgrade vSphere. + VsphereUpgradeObjects []VsphereUpgradeObject `mandatory:"false" json:"vsphereUpgradeObjects"` + + // The initial OCPU count of the Cluster's ESXi hosts. + InitialHostOcpuCount *float32 `mandatory:"false" json:"initialHostOcpuCount"` + + // Indicates whether shielded instance is enabled at the Cluster level. + IsShieldedInstanceEnabled *bool `mandatory:"false" json:"isShieldedInstanceEnabled"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. + CapacityReservationId *string `mandatory:"false" json:"capacityReservationId"` + + // Datastores used for the Cluster. + Datastores []DatastoreDetails `mandatory:"false" json:"datastores"` +} + +func (m Cluster) String() string { + return common.PointerString(m) +} + +// 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 (m Cluster) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingVsphereTypesEnum(string(m.VsphereType)); !ok && m.VsphereType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VsphereType: %s. Supported values are: %s.", m.VsphereType, strings.Join(GetVsphereTypesEnumStringValues(), ","))) + } + + if _, ok := GetMappingCommitmentEnum(string(m.InitialCommitment)); !ok && m.InitialCommitment != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for InitialCommitment: %s. Supported values are: %s.", m.InitialCommitment, strings.Join(GetCommitmentEnumStringValues(), ","))) + } + if _, ok := GetMappingLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/supported_sku_summary_collection.go b/ocvp/cluster_collection.go similarity index 77% rename from ocvp/supported_sku_summary_collection.go rename to ocvp/cluster_collection.go index f5be8450b2..8145e8405a 100644 --- a/ocvp/supported_sku_summary_collection.go +++ b/ocvp/cluster_collection.go @@ -16,21 +16,21 @@ import ( "strings" ) -// SupportedSkuSummaryCollection A specific SKU. -type SupportedSkuSummaryCollection struct { +// ClusterCollection A list of Clusters. +type ClusterCollection struct { - // A list of the supported SKUs. - Items []SupportedSkuSummary `mandatory:"true" json:"items"` + // A list of Clusters. + Items []ClusterSummary `mandatory:"true" json:"items"` } -func (m SupportedSkuSummaryCollection) String() string { +func (m ClusterCollection) String() string { return common.PointerString(m) } // 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 (m SupportedSkuSummaryCollection) ValidateEnumValue() (bool, error) { +func (m ClusterCollection) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { diff --git a/ocvp/cluster_summary.go b/ocvp/cluster_summary.go new file mode 100644 index 0000000000..49c262c6e0 --- /dev/null +++ b/ocvp/cluster_summary.go @@ -0,0 +1,115 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ClusterSummary A summary of the Cluster. +type ClusterSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that + // contains the Cluster. + Id *string `mandatory:"true" json:"id"` + + // The availability domain that the Cluster's ESXi hosts are running in. For Multi-AD Cluster, it is `multi-AD`. + ComputeAvailabilityDomain *string `mandatory:"true" json:"computeAvailabilityDomain"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC that the + // Cluster belongs to. + SddcId *string `mandatory:"true" json:"sddcId"` + + // A descriptive name for the Cluster. It must be unique, start with a letter, and contain only letters, digits, + // whitespaces, dashes and underscores. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // In general, this is a specific version of bundled VMware software supported by + // Oracle Cloud VMware Solution (see + // ListSupportedVmwareSoftwareVersions). + // This attribute is not guaranteed to reflect the version of + // software currently installed on the ESXi hosts in the Cluster. The purpose + // of this attribute is to show the version of software that the Oracle + // Cloud VMware Solution will install on any new ESXi hosts that you *add to this + // Cluster in the future* with CreateEsxiHost. + // Therefore, if you upgrade the existing ESXi hosts in the Cluster to use a newer + // version of bundled VMware software supported by the Oracle Cloud VMware Solution, you + // should use UpdateCluster to update the Cluster's + // `vmwareSoftwareVersion` with that new version. + VmwareSoftwareVersion *string `mandatory:"true" json:"vmwareSoftwareVersion"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that + // contains the Cluster. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The number of ESXi hosts in the Cluster. + EsxiHostsCount *int `mandatory:"true" json:"esxiHostsCount"` + + // The initial compute shape of the Cluster's ESXi hosts. + // ListSupportedHostShapes. + InitialHostShapeName *string `mandatory:"true" json:"initialHostShapeName"` + + // vSphere Cluster types. + VsphereType VsphereTypesEnum `mandatory:"true" json:"vsphereType"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The date and time the Cluster was created, in the format defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time the Cluster was updated, in the format defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The current state of the Cluster. + LifecycleState LifecycleStatesEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Indicates whether shielded instance is enabled at the Cluster level. + IsShieldedInstanceEnabled *bool `mandatory:"false" json:"isShieldedInstanceEnabled"` + + // The initial OCPU count of the Cluster's ESXi hosts. + InitialHostOcpuCount *float32 `mandatory:"false" json:"initialHostOcpuCount"` +} + +func (m ClusterSummary) String() string { + return common.PointerString(m) +} + +// 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 (m ClusterSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingVsphereTypesEnum(string(m.VsphereType)); !ok && m.VsphereType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VsphereType: %s. Supported values are: %s.", m.VsphereType, strings.Join(GetVsphereTypesEnumStringValues(), ","))) + } + + if _, ok := GetMappingLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/commitment.go b/ocvp/commitment.go new file mode 100644 index 0000000000..6864390046 --- /dev/null +++ b/ocvp/commitment.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "strings" +) + +// CommitmentEnum Enum with underlying type: string +type CommitmentEnum string + +// Set of constants representing the allowable values for CommitmentEnum +const ( + CommitmentHour CommitmentEnum = "HOUR" + CommitmentMonth CommitmentEnum = "MONTH" + CommitmentOneYear CommitmentEnum = "ONE_YEAR" + CommitmentThreeYears CommitmentEnum = "THREE_YEARS" +) + +var mappingCommitmentEnum = map[string]CommitmentEnum{ + "HOUR": CommitmentHour, + "MONTH": CommitmentMonth, + "ONE_YEAR": CommitmentOneYear, + "THREE_YEARS": CommitmentThreeYears, +} + +var mappingCommitmentEnumLowerCase = map[string]CommitmentEnum{ + "hour": CommitmentHour, + "month": CommitmentMonth, + "one_year": CommitmentOneYear, + "three_years": CommitmentThreeYears, +} + +// GetCommitmentEnumValues Enumerates the set of values for CommitmentEnum +func GetCommitmentEnumValues() []CommitmentEnum { + values := make([]CommitmentEnum, 0) + for _, v := range mappingCommitmentEnum { + values = append(values, v) + } + return values +} + +// GetCommitmentEnumStringValues Enumerates the set of values in String for CommitmentEnum +func GetCommitmentEnumStringValues() []string { + return []string{ + "HOUR", + "MONTH", + "ONE_YEAR", + "THREE_YEARS", + } +} + +// GetMappingCommitmentEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCommitmentEnum(val string) (CommitmentEnum, bool) { + enum, ok := mappingCommitmentEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/ocvp/create_cluster_details.go b/ocvp/create_cluster_details.go new file mode 100644 index 0000000000..3b21b8530a --- /dev/null +++ b/ocvp/create_cluster_details.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateClusterDetails Details of the Cluster. +type CreateClusterDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC that the + // Cluster belongs to. + SddcId *string `mandatory:"true" json:"sddcId"` + + // The availability domain to create the Cluster's ESXi hosts in. For multi-AD Cluster deployment, set to `multi-AD`. + ComputeAvailabilityDomain *string `mandatory:"true" json:"computeAvailabilityDomain"` + + // The number of ESXi hosts to create in the Cluster. You can add more hosts later + // (see CreateEsxiHost). + // **Note:** If you later delete EXSi hosts from a production Cluster to make SDDC + // total host count less than 3, you are still billed for the 3 minimum recommended + // ESXi hosts. Also, you cannot add more VMware workloads to the Cluster until the + // SDDC again has at least 3 ESXi hosts. + EsxiHostsCount *int `mandatory:"true" json:"esxiHostsCount"` + + NetworkConfiguration *NetworkConfiguration `mandatory:"true" json:"networkConfiguration"` + + // A descriptive name for the Cluster. + // Cluster name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A prefix used in the name of each ESXi host and Compute instance in the Cluster. + // If this isn't set, the Cluster's `displayName` is used as the prefix. + // For example, if the value is `myCluster`, the ESXi hosts are named `myCluster-1`, + // `myCluster-2`, and so on. + InstanceDisplayNamePrefix *string `mandatory:"false" json:"instanceDisplayNamePrefix"` + + // The billing option selected during Cluster creation. + // ListSupportedCommitments. + InitialCommitment CommitmentEnum `mandatory:"false" json:"initialCommitment,omitempty"` + + // The CIDR block for the IP addresses that VMware VMs in the Cluster use to run application + // workloads. + WorkloadNetworkCidr *string `mandatory:"false" json:"workloadNetworkCidr"` + + // The initial compute shape of the Cluster's ESXi hosts. + // ListSupportedHostShapes. + InitialHostShapeName *string `mandatory:"false" json:"initialHostShapeName"` + + // The initial OCPU count of the Cluster's ESXi hosts. + InitialHostOcpuCount *float32 `mandatory:"false" json:"initialHostOcpuCount"` + + // Indicates whether shielded instance is enabled for this Cluster. + IsShieldedInstanceEnabled *bool `mandatory:"false" json:"isShieldedInstanceEnabled"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. + CapacityReservationId *string `mandatory:"false" json:"capacityReservationId"` + + // A list of datastore info for the Cluster. + // This value is required only when `initialHostShapeName` is a standard shape. + Datastores []DatastoreInfo `mandatory:"false" json:"datastores"` + + // The VMware software bundle to install on the ESXi hosts in the Cluster. To get a list of the available versions, use + // ListSupportedVmwareSoftwareVersions. + VmwareSoftwareVersion *string `mandatory:"false" json:"vmwareSoftwareVersion"` + + // The ESXi software bundle to install on the ESXi hosts in the Cluster. + // Only versions under the same vmwareSoftwareVersion and have been validate by Oracle Cloud VMware Solution will be accepted. + // To get a list of the available versions, use + // ListSupportedVmwareSoftwareVersions. + EsxiSoftwareVersion *string `mandatory:"false" json:"esxiSoftwareVersion"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateClusterDetails) String() string { + return common.PointerString(m) +} + +// 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 (m CreateClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCommitmentEnum(string(m.InitialCommitment)); !ok && m.InitialCommitment != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for InitialCommitment: %s. Supported values are: %s.", m.InitialCommitment, strings.Join(GetCommitmentEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/create_cluster_request_response.go b/ocvp/create_cluster_request_response.go new file mode 100644 index 0000000000..333ce7f971 --- /dev/null +++ b/ocvp/create_cluster_request_response.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2023, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateClusterRequest wrapper for the CreateCluster operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/CreateCluster.go.html to see an example of how to use CreateClusterRequest. +type CreateClusterRequest struct { + + // Details for the Cluster. + CreateClusterDetails `contributesTo:"body"` + + // 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. If you need to contact Oracle about a particular + // request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 CreateClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateClusterRequest) 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 CreateClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateClusterRequest) 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 CreateClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateClusterResponse wrapper for the CreateCluster operation +type CreateClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + 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 CreateClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ocvp/create_esxi_host_details.go b/ocvp/create_esxi_host_details.go index 2e6f34a857..63418cd09b 100644 --- a/ocvp/create_esxi_host_details.go +++ b/ocvp/create_esxi_host_details.go @@ -16,19 +16,19 @@ import ( "strings" ) -// CreateEsxiHostDetails Details of the ESXi host to add to the SDDC. +// CreateEsxiHostDetails Details of the ESXi host to add to the Cluster. type CreateEsxiHostDetails struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC to add the - // ESXi host to. - SddcId *string `mandatory:"true" json:"sddcId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster to add the ESXi host to. + ClusterId *string `mandatory:"true" json:"clusterId"` // A descriptive name for the ESXi host. It's changeable. - // Esxi Host name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the SDDC. - // If this attribute is not specified, the SDDC's `instanceDisplayNamePrefix` attribute is used + // Esxi Host name requirements are 1-16 character length limit, Must start with a letter, + // Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the Cluster. + // If this attribute is not specified, the Cluster's `instanceDisplayNamePrefix` attribute is used // to name and incrementally number the ESXi host. For example, if you're creating the fourth - // ESXi host in the SDDC, and `instanceDisplayNamePrefix` is `MySDDC`, the host's display - // name is `MySDDC-4`. + // ESXi host in the Cluster, and `instanceDisplayNamePrefix` is `MyCluster`, the host's display + // name is `MyCluster-4`. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` @@ -36,25 +36,19 @@ type CreateEsxiHostDetails struct { BillingDonorHostId *string `mandatory:"false" json:"billingDonorHostId"` // The billing option currently used by the ESXi host. - // ListSupportedSkus. - CurrentSku SkuEnum `mandatory:"false" json:"currentSku,omitempty"` + // ListSupportedCommitments. + CurrentCommitment CommitmentEnum `mandatory:"false" json:"currentCommitment,omitempty"` // The billing option to switch to after the existing billing cycle ends. - // If `nextSku` is null or empty, `currentSku` continues to the next billing cycle. - // ListSupportedSkus. - NextSku SkuEnum `mandatory:"false" json:"nextSku,omitempty"` + // If `nextCommitment` is null or empty, `currentCommitment` continues to the next billing cycle. + // ListSupportedCommitments. + NextCommitment CommitmentEnum `mandatory:"false" json:"nextCommitment,omitempty"` // The availability domain to create the ESXi host in. - // If keep empty, for AD-specific SDDC, new ESXi host will be created in the same availability domain; - // for multi-AD SDDC, new ESXi host will be auto assigned to the next availability domain following evenly distribution strategy. + // If keep empty, for AD-specific Cluster, new ESXi host will be created in the same availability domain; + // for multi-AD Cluster, new ESXi host will be auto assigned to the next availability domain following evenly distribution strategy. ComputeAvailabilityDomain *string `mandatory:"false" json:"computeAvailabilityDomain"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the ESXi host that - // is failed. This is an optional parameter. If this parameter is specified, a new ESXi - // host will be created to replace the failed one, and the `failedEsxiHostId` field - // will be updated in the newly created Esxi host. - FailedEsxiHostId *string `mandatory:"false" json:"failedEsxiHostId"` - // The compute shape name of the ESXi host. // ListSupportedHostShapes. HostShapeName *string `mandatory:"false" json:"hostShapeName"` @@ -65,12 +59,11 @@ type CreateEsxiHostDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. CapacityReservationId *string `mandatory:"false" json:"capacityReservationId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the ESXi host that - // will be upgraded. This is an optional parameter. If this parameter - // is specified, an ESXi host with the new software version is created to replace the - // original one, and the `nonUpgradedEsxiHostId` field is updated in the newly - // created Esxi host. See Upgrading VMware Software (https://docs.cloud.oracle.com/Content/VMware/Concepts/upgrade.htm) for more information. - NonUpgradedEsxiHostId *string `mandatory:"false" json:"nonUpgradedEsxiHostId"` + // The ESXi software bundle to install on the ESXi host. + // Only versions under the same vmwareSoftwareVersion and have been validate by Oracle Cloud VMware Solution will be accepted. + // To get a list of the available versions, use + // ListSupportedVmwareSoftwareVersions. + EsxiSoftwareVersion *string `mandatory:"false" json:"esxiSoftwareVersion"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). @@ -93,11 +86,11 @@ func (m CreateEsxiHostDetails) String() string { func (m CreateEsxiHostDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingSkuEnum(string(m.CurrentSku)); !ok && m.CurrentSku != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CurrentSku: %s. Supported values are: %s.", m.CurrentSku, strings.Join(GetSkuEnumStringValues(), ","))) + if _, ok := GetMappingCommitmentEnum(string(m.CurrentCommitment)); !ok && m.CurrentCommitment != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CurrentCommitment: %s. Supported values are: %s.", m.CurrentCommitment, strings.Join(GetCommitmentEnumStringValues(), ","))) } - if _, ok := GetMappingSkuEnum(string(m.NextSku)); !ok && m.NextSku != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NextSku: %s. Supported values are: %s.", m.NextSku, strings.Join(GetSkuEnumStringValues(), ","))) + if _, ok := GetMappingCommitmentEnum(string(m.NextCommitment)); !ok && m.NextCommitment != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NextCommitment: %s. Supported values are: %s.", m.NextCommitment, strings.Join(GetCommitmentEnumStringValues(), ","))) } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) diff --git a/ocvp/create_sddc_details.go b/ocvp/create_sddc_details.go index 89575268a9..b799588f62 100644 --- a/ocvp/create_sddc_details.go +++ b/ocvp/create_sddc_details.go @@ -19,9 +19,6 @@ import ( // CreateSddcDetails Details of the SDDC. type CreateSddcDetails struct { - // The availability domain to create the SDDC's ESXi hosts in. For multi-AD SDDC deployment, set to `multi-AD`. - ComputeAvailabilityDomain *string `mandatory:"true" json:"computeAvailabilityDomain"` - // The VMware software bundle to install on the ESXi hosts in the SDDC. To get a // list of the available versions, use // ListSupportedVmwareSoftwareVersions. @@ -30,111 +27,30 @@ type CreateSddcDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to contain the SDDC. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The number of ESXi hosts to create in the SDDC. You can add more hosts later - // (see CreateEsxiHost). Creating - // a SDDC with a ESXi host count of 1 will be considered a single ESXi host SDDC. - // **Note:** If you later delete EXSi hosts from a production SDDC to total less - // than 3, you are still billed for the 3 minimum recommended ESXi hosts. Also, - // you cannot add more VMware workloads to the SDDC until it again has at least - // 3 ESXi hosts. - EsxiHostsCount *int `mandatory:"true" json:"esxiHostsCount"` + // HCX configuration of the SDDC. + HcxMode HcxModesEnum `mandatory:"true" json:"hcxMode"` + + InitialConfiguration *InitialConfiguration `mandatory:"true" json:"initialConfiguration"` // One or more public SSH keys to be included in the `~/.ssh/authorized_keys` file for // the default user on each ESXi host. Use a newline character to separate multiple keys. // The SSH keys must be in the format required for the `authorized_keys` file SshAuthorizedKeys *string `mandatory:"true" json:"sshAuthorizedKeys"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the management subnet to use - // for provisioning the SDDC. - ProvisioningSubnetId *string `mandatory:"true" json:"provisioningSubnetId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for the vSphere - // component of the VMware environment. - VsphereVlanId *string `mandatory:"true" json:"vsphereVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for the vMotion - // component of the VMware environment. - VmotionVlanId *string `mandatory:"true" json:"vmotionVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for the vSAN - // component of the VMware environment. - VsanVlanId *string `mandatory:"true" json:"vsanVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for the NSX VTEP - // component of the VMware environment. - NsxVTepVlanId *string `mandatory:"true" json:"nsxVTepVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for the NSX Edge VTEP - // component of the VMware environment. - NsxEdgeVTepVlanId *string `mandatory:"true" json:"nsxEdgeVTepVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for the NSX Edge - // Uplink 1 component of the VMware environment. - NsxEdgeUplink1VlanId *string `mandatory:"true" json:"nsxEdgeUplink1VlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for the NSX Edge - // Uplink 2 component of the VMware environment. - // **Note:** This VLAN is reserved for future use to deploy public-facing applications on the VMware SDDC. - NsxEdgeUplink2VlanId *string `mandatory:"true" json:"nsxEdgeUplink2VlanId"` - // A descriptive name for the SDDC. // SDDC name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` - // A prefix used in the name of each ESXi host and Compute instance in the SDDC. - // If this isn't set, the SDDC's `displayName` is used as the prefix. - // For example, if the value is `mySDDC`, the ESXi hosts are named `mySDDC-1`, - // `mySDDC-2`, and so on. - InstanceDisplayNamePrefix *string `mandatory:"false" json:"instanceDisplayNamePrefix"` - - // The billing option selected during SDDC creation. - // ListSupportedSkus. - InitialSku SkuEnum `mandatory:"false" json:"initialSku,omitempty"` - - // For SDDC with dense compute shapes, this parameter indicates whether to enable HCX Advanced for this SDDC. - // For SDDC with standard compute shapes, this parameter is equivalent to `isHcxEnterpriseEnabled`. - IsHcxEnabled *bool `mandatory:"false" json:"isHcxEnabled"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for the HCX - // component of the VMware environment. This value is required only when `isHcxEnabled` is true. - HcxVlanId *string `mandatory:"false" json:"hcxVlanId"` - - // Indicates whether to enable HCX Enterprise for this SDDC. - IsHcxEnterpriseEnabled *bool `mandatory:"false" json:"isHcxEnterpriseEnabled"` + // The ESXi software bundle to install on the ESXi hosts in the SDDC. + // Only versions under the same vmwareSoftwareVersion and have been validate by Oracle Cloud VMware Solution will be accepted. + // To get a list of the available versions, use + // ListSupportedVmwareSoftwareVersions. + EsxiSoftwareVersion *string `mandatory:"false" json:"esxiSoftwareVersion"` // Indicates whether this SDDC is designated for only single ESXi host. IsSingleHostSddc *bool `mandatory:"false" json:"isSingleHostSddc"` - // The CIDR block for the IP addresses that VMware VMs in the SDDC use to run application - // workloads. - WorkloadNetworkCidr *string `mandatory:"false" json:"workloadNetworkCidr"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the vSphere Replication component of the VMware environment. - ReplicationVlanId *string `mandatory:"false" json:"replicationVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the Provisioning component of the VMware environment. - ProvisioningVlanId *string `mandatory:"false" json:"provisioningVlanId"` - - // The initial compute shape of the SDDC's ESXi hosts. - // ListSupportedHostShapes. - InitialHostShapeName *string `mandatory:"false" json:"initialHostShapeName"` - - // The initial OCPU count of the SDDC's ESXi hosts. - InitialHostOcpuCount *float32 `mandatory:"false" json:"initialHostOcpuCount"` - - // Indicates whether shielded instance is enabled for this SDDC. - IsShieldedInstanceEnabled *bool `mandatory:"false" json:"isShieldedInstanceEnabled"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. - CapacityReservationId *string `mandatory:"false" json:"capacityReservationId"` - - // A list of datastore info for the SDDC. - // This value is required only when `initialHostShapeName` is a standard shape. - Datastores []DatastoreInfo `mandatory:"false" json:"datastores"` - // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` @@ -155,10 +71,10 @@ func (m CreateSddcDetails) String() string { // Not recommended for calling this function directly func (m CreateSddcDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} - - if _, ok := GetMappingSkuEnum(string(m.InitialSku)); !ok && m.InitialSku != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for InitialSku: %s. Supported values are: %s.", m.InitialSku, strings.Join(GetSkuEnumStringValues(), ","))) + if _, ok := GetMappingHcxModesEnum(string(m.HcxMode)); !ok && m.HcxMode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for HcxMode: %s. Supported values are: %s.", m.HcxMode, strings.Join(GetHcxModesEnumStringValues(), ","))) } + if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/ocvp/datastore_summary.go b/ocvp/datastore_details.go similarity index 90% rename from ocvp/datastore_summary.go rename to ocvp/datastore_details.go index 5178b0f020..e1510e8d6a 100644 --- a/ocvp/datastore_summary.go +++ b/ocvp/datastore_details.go @@ -16,8 +16,8 @@ import ( "strings" ) -// DatastoreSummary Datastore summary for a getting an Sddc. -type DatastoreSummary struct { +// DatastoreDetails Datastore summary for a getting an Sddc. +type DatastoreDetails struct { // A list of OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)s of Block Storage Volumes. BlockVolumeIds []string `mandatory:"true" json:"blockVolumeIds"` @@ -29,14 +29,14 @@ type DatastoreSummary struct { Capacity *float64 `mandatory:"true" json:"capacity"` } -func (m DatastoreSummary) String() string { +func (m DatastoreDetails) String() string { return common.PointerString(m) } // 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 (m DatastoreSummary) ValidateEnumValue() (bool, error) { +func (m DatastoreDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if _, ok := GetMappingDatastoreTypesEnum(string(m.DatastoreType)); !ok && m.DatastoreType != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DatastoreType: %s. Supported values are: %s.", m.DatastoreType, strings.Join(GetDatastoreTypesEnumStringValues(), ","))) diff --git a/ocvp/delete_cluster_request_response.go b/ocvp/delete_cluster_request_response.go new file mode 100644 index 0000000000..4c6782bd4d --- /dev/null +++ b/ocvp/delete_cluster_request_response.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2023, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteClusterRequest wrapper for the DeleteCluster operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DeleteCluster.go.html to see an example of how to use DeleteClusterRequest. +type DeleteClusterRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster. + ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` + + // 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"` + + // Unique identifier for the request. If you need to contact Oracle about a particular + // request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteClusterRequest) 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 DeleteClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteClusterRequest) 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 DeleteClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteClusterResponse wrapper for the DeleteCluster operation +type DeleteClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + 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 DeleteClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ocvp/esxi_host.go b/ocvp/esxi_host.go index b5cc15d9e9..1d9de1f5ae 100644 --- a/ocvp/esxi_host.go +++ b/ocvp/esxi_host.go @@ -16,7 +16,7 @@ import ( "strings" ) -// EsxiHost An ESXi host is a node in an SDDC. At a minimum, each SDDC has 3 ESXi hosts +// EsxiHost An ESXi host is a node in a Cluster. At a minimum, each Cluster has 3 ESXi hosts // that are used to implement a functioning VMware environment. // In terms of implementation, an ESXi host is a Compute instance that // is configured with the chosen bundle of VMware software. @@ -35,17 +35,21 @@ type EsxiHost struct { // ESXi host belongs to. SddcId *string `mandatory:"true" json:"sddcId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster that the + // ESXi host belongs to. + ClusterId *string `mandatory:"true" json:"clusterId"` + // The billing option currently used by the ESXi host. - // ListSupportedSkus. - CurrentSku SkuEnum `mandatory:"true" json:"currentSku"` + // ListSupportedCommitments. + CurrentCommitment CommitmentEnum `mandatory:"true" json:"currentCommitment"` // The billing option to switch to after the current billing cycle ends. - // If `nextSku` is null or empty, `currentSku` continues to the next billing cycle. - // ListSupportedSkus. - NextSku SkuEnum `mandatory:"true" json:"nextSku"` + // If `nextCommitment` is null or empty, `currentCommitment` continues to the next billing cycle. + // ListSupportedCommitments. + NextCommitment CommitmentEnum `mandatory:"true" json:"nextCommitment"` - // Current billing cycle end date. If the value in `currentSku` and `nextSku` are different, the value specified in `nextSku` - // becomes the new `currentSKU` when the `contractEndDate` is reached. + // Current billing cycle end date. If the value in `currentCommitment` and `nextCommitment` are different, the value specified in `nextCommitment` + // becomes the new `currentCommitment` when the `contractEndDate` is reached. // Example: `2016-08-25T21:10:29.600Z` BillingContractEndDate *common.SDKTime `mandatory:"true" json:"billingContractEndDate"` @@ -70,7 +74,7 @@ type EsxiHost struct { DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that - // contains the SDDC. + // contains the Cluster. CompartmentId *string `mandatory:"false" json:"compartmentId"` // In terms of implementation, an ESXi host is a Compute instance that @@ -114,6 +118,9 @@ type EsxiHost struct { // Example: `2021-07-25T21:10:29.600Z` GracePeriodEndDate *common.SDKTime `mandatory:"false" json:"gracePeriodEndDate"` + // The version of ESXi software that Oracle Cloud VMware Solution installed on the ESXi hosts. + EsxiSoftwareVersion *string `mandatory:"false" json:"esxiSoftwareVersion"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the ESXi host that // will be upgraded. NonUpgradedEsxiHostId *string `mandatory:"false" json:"nonUpgradedEsxiHostId"` @@ -138,11 +145,11 @@ func (m EsxiHost) String() string { // Not recommended for calling this function directly func (m EsxiHost) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingSkuEnum(string(m.CurrentSku)); !ok && m.CurrentSku != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CurrentSku: %s. Supported values are: %s.", m.CurrentSku, strings.Join(GetSkuEnumStringValues(), ","))) + if _, ok := GetMappingCommitmentEnum(string(m.CurrentCommitment)); !ok && m.CurrentCommitment != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CurrentCommitment: %s. Supported values are: %s.", m.CurrentCommitment, strings.Join(GetCommitmentEnumStringValues(), ","))) } - if _, ok := GetMappingSkuEnum(string(m.NextSku)); !ok && m.NextSku != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NextSku: %s. Supported values are: %s.", m.NextSku, strings.Join(GetSkuEnumStringValues(), ","))) + if _, ok := GetMappingCommitmentEnum(string(m.NextCommitment)); !ok && m.NextCommitment != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NextCommitment: %s. Supported values are: %s.", m.NextCommitment, strings.Join(GetCommitmentEnumStringValues(), ","))) } if _, ok := GetMappingLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { diff --git a/ocvp/esxi_host_summary.go b/ocvp/esxi_host_summary.go index 1590bda9cc..716a10c32d 100644 --- a/ocvp/esxi_host_summary.go +++ b/ocvp/esxi_host_summary.go @@ -26,17 +26,21 @@ type EsxiHostSummary struct { // ESXi host belongs to. SddcId *string `mandatory:"true" json:"sddcId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster that the + // ESXi host belongs to. + ClusterId *string `mandatory:"true" json:"clusterId"` + // The billing option currently used by the ESXi host. - // ListSupportedSkus. - CurrentSku SkuEnum `mandatory:"true" json:"currentSku"` + // ListSupportedCommitments. + CurrentCommitment CommitmentEnum `mandatory:"true" json:"currentCommitment"` // The billing option to switch to after the current billing cycle ends. - // If `nextSku` is null or empty, `currentSku` continues to the next billing cycle. - // ListSupportedSkus. - NextSku SkuEnum `mandatory:"true" json:"nextSku"` + // If `nextCommitment` is null or empty, `currentCommitment` continues to the next billing cycle. + // ListSupportedCommitments. + NextCommitment CommitmentEnum `mandatory:"true" json:"nextCommitment"` - // Current billing cycle end date. If the value in `currentSku` and `nextSku` are different, the value specified in `nextSku` - // becomes the new `currentSKU` when the `contractEndDate` is reached. + // Current billing cycle end date. If the value in `currentCommitment` and `nextCommitment` are different, the value specified in `nextCommitment` + // becomes the new `currentCommitment` when the `contractEndDate` is reached. // Example: `2016-08-25T21:10:29.600Z` BillingContractEndDate *common.SDKTime `mandatory:"true" json:"billingContractEndDate"` @@ -65,7 +69,7 @@ type EsxiHostSummary struct { DisplayName *string `mandatory:"false" json:"displayName"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that - // contains the SDDC. + // contains the Cluster. CompartmentId *string `mandatory:"false" json:"compartmentId"` // In terms of implementation, an ESXi host is a Compute instance that @@ -130,11 +134,11 @@ func (m EsxiHostSummary) String() string { // Not recommended for calling this function directly func (m EsxiHostSummary) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingSkuEnum(string(m.CurrentSku)); !ok && m.CurrentSku != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CurrentSku: %s. Supported values are: %s.", m.CurrentSku, strings.Join(GetSkuEnumStringValues(), ","))) + if _, ok := GetMappingCommitmentEnum(string(m.CurrentCommitment)); !ok && m.CurrentCommitment != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CurrentCommitment: %s. Supported values are: %s.", m.CurrentCommitment, strings.Join(GetCommitmentEnumStringValues(), ","))) } - if _, ok := GetMappingSkuEnum(string(m.NextSku)); !ok && m.NextSku != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NextSku: %s. Supported values are: %s.", m.NextSku, strings.Join(GetSkuEnumStringValues(), ","))) + if _, ok := GetMappingCommitmentEnum(string(m.NextCommitment)); !ok && m.NextCommitment != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NextCommitment: %s. Supported values are: %s.", m.NextCommitment, strings.Join(GetCommitmentEnumStringValues(), ","))) } if _, ok := GetMappingLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { diff --git a/ocvp/get_cluster_request_response.go b/ocvp/get_cluster_request_response.go new file mode 100644 index 0000000000..1dbd9c6dd5 --- /dev/null +++ b/ocvp/get_cluster_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetClusterRequest wrapper for the GetCluster operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/GetCluster.go.html to see an example of how to use GetClusterRequest. +type GetClusterRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster. + ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` + + // Unique identifier for the request. If you need to contact Oracle about a particular + // request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetClusterRequest) 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 GetClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetClusterRequest) 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 GetClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetClusterResponse wrapper for the GetCluster operation +type GetClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Cluster instance + Cluster `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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 GetClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ocvp/hcx_modes.go b/ocvp/hcx_modes.go new file mode 100644 index 0000000000..9cbf89acca --- /dev/null +++ b/ocvp/hcx_modes.go @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "strings" +) + +// HcxModesEnum Enum with underlying type: string +type HcxModesEnum string + +// Set of constants representing the allowable values for HcxModesEnum +const ( + HcxModesDisabled HcxModesEnum = "DISABLED" + HcxModesAdvanced HcxModesEnum = "ADVANCED" + HcxModesEnterprise HcxModesEnum = "ENTERPRISE" +) + +var mappingHcxModesEnum = map[string]HcxModesEnum{ + "DISABLED": HcxModesDisabled, + "ADVANCED": HcxModesAdvanced, + "ENTERPRISE": HcxModesEnterprise, +} + +var mappingHcxModesEnumLowerCase = map[string]HcxModesEnum{ + "disabled": HcxModesDisabled, + "advanced": HcxModesAdvanced, + "enterprise": HcxModesEnterprise, +} + +// GetHcxModesEnumValues Enumerates the set of values for HcxModesEnum +func GetHcxModesEnumValues() []HcxModesEnum { + values := make([]HcxModesEnum, 0) + for _, v := range mappingHcxModesEnum { + values = append(values, v) + } + return values +} + +// GetHcxModesEnumStringValues Enumerates the set of values in String for HcxModesEnum +func GetHcxModesEnumStringValues() []string { + return []string{ + "DISABLED", + "ADVANCED", + "ENTERPRISE", + } +} + +// GetMappingHcxModesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingHcxModesEnum(val string) (HcxModesEnum, bool) { + enum, ok := mappingHcxModesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/ocvp/initial_cluster_configuration.go b/ocvp/initial_cluster_configuration.go new file mode 100644 index 0000000000..6b2beb2309 --- /dev/null +++ b/ocvp/initial_cluster_configuration.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InitialClusterConfiguration Details of the initial Cluster of SDDC. +type InitialClusterConfiguration struct { + + // vSphere Cluster types. + VsphereType VsphereTypesEnum `mandatory:"true" json:"vsphereType"` + + // The availability domain to create the Cluster's ESXi hosts in. For multi-AD Cluster deployment, set to `multi-AD`. + ComputeAvailabilityDomain *string `mandatory:"true" json:"computeAvailabilityDomain"` + + // The number of ESXi hosts to create in the Cluster. You can add more hosts later + // (see CreateEsxiHost). Creating + // a Cluster with a ESXi host count of 1 will be considered a single ESXi host Cluster. + // **Note:** If you later delete EXSi hosts from a production Cluster to total less + // than 3, you are still billed for the 3 minimum recommended ESXi hosts. Also, + // you cannot add more VMware workloads to the Cluster until it again has at least + // 3 ESXi hosts. + EsxiHostsCount *int `mandatory:"true" json:"esxiHostsCount"` + + NetworkConfiguration *NetworkConfiguration `mandatory:"true" json:"networkConfiguration"` + + // A descriptive name for the Cluster. + // Cluster name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A prefix used in the name of each ESXi host and Compute instance in the Cluster. + // If this isn't set, the Cluster's `displayName` is used as the prefix. + // For example, if the value is `myCluster`, the ESXi hosts are named `myCluster-1`, + // `myCluster-2`, and so on. + InstanceDisplayNamePrefix *string `mandatory:"false" json:"instanceDisplayNamePrefix"` + + // The billing option selected during Cluster creation. + // ListSupportedCommitments. + InitialCommitment CommitmentEnum `mandatory:"false" json:"initialCommitment,omitempty"` + + // The CIDR block for the IP addresses that VMware VMs in the Cluster use to run application + // workloads. + WorkloadNetworkCidr *string `mandatory:"false" json:"workloadNetworkCidr"` + + // The initial compute shape of the Cluster's ESXi hosts. + // ListSupportedHostShapes. + InitialHostShapeName *string `mandatory:"false" json:"initialHostShapeName"` + + // The initial OCPU count of the Cluster's ESXi hosts. + InitialHostOcpuCount *float32 `mandatory:"false" json:"initialHostOcpuCount"` + + // Indicates whether shielded instance is enabled for this Cluster. + IsShieldedInstanceEnabled *bool `mandatory:"false" json:"isShieldedInstanceEnabled"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. + CapacityReservationId *string `mandatory:"false" json:"capacityReservationId"` + + // A list of datastore info for the Cluster. + // This value is required only when `initialHostShapeName` is a standard shape. + Datastores []DatastoreInfo `mandatory:"false" json:"datastores"` +} + +func (m InitialClusterConfiguration) String() string { + return common.PointerString(m) +} + +// 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 (m InitialClusterConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingVsphereTypesEnum(string(m.VsphereType)); !ok && m.VsphereType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for VsphereType: %s. Supported values are: %s.", m.VsphereType, strings.Join(GetVsphereTypesEnumStringValues(), ","))) + } + + if _, ok := GetMappingCommitmentEnum(string(m.InitialCommitment)); !ok && m.InitialCommitment != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for InitialCommitment: %s. Supported values are: %s.", m.InitialCommitment, strings.Join(GetCommitmentEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/initial_configuration.go b/ocvp/initial_configuration.go new file mode 100644 index 0000000000..90656f9faa --- /dev/null +++ b/ocvp/initial_configuration.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InitialConfiguration Details of SDDC initial configuration +type InitialConfiguration struct { + + // The configurations for Clusters initially created in the SDDC. + InitialClusterConfigurations []InitialClusterConfiguration `mandatory:"true" json:"initialClusterConfigurations"` +} + +func (m InitialConfiguration) String() string { + return common.PointerString(m) +} + +// 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 (m InitialConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/inplace_upgrade_request_response.go b/ocvp/inplace_upgrade_request_response.go new file mode 100644 index 0000000000..946f75761c --- /dev/null +++ b/ocvp/inplace_upgrade_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2023, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// InplaceUpgradeRequest wrapper for the InplaceUpgrade operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/InplaceUpgrade.go.html to see an example of how to use InplaceUpgradeRequest. +type InplaceUpgradeRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the ESXi host. + EsxiHostId *string `mandatory:"true" contributesTo:"path" name:"esxiHostId"` + + // 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"` + + // 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"` + + // Unique identifier for the request. If you need to contact Oracle about a particular + // request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 InplaceUpgradeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request InplaceUpgradeRequest) 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 InplaceUpgradeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request InplaceUpgradeRequest) 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 InplaceUpgradeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// InplaceUpgradeResponse wrapper for the InplaceUpgrade operation +type InplaceUpgradeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + 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 InplaceUpgradeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response InplaceUpgradeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ocvp/list_clusters_request_response.go b/ocvp/list_clusters_request_response.go new file mode 100644 index 0000000000..f3741ec4b7 --- /dev/null +++ b/ocvp/list_clusters_request_response.go @@ -0,0 +1,279 @@ +// Copyright (c) 2016, 2018, 2023, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListClustersRequest wrapper for the ListClusters operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListClusters.go.html to see an example of how to use ListClustersRequest. +type ListClustersRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC. + SddcId *string `mandatory:"false" contributesTo:"query" name:"sddcId"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // For list pagination. The maximum number of results per page, or items to return in a paginated + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from the previous "List" + // call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListClustersSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListClustersSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique identifier for the request. If you need to contact Oracle about a particular + // request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The lifecycle state of the resource. + LifecycleState ListClustersLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment as optional parameter. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // 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 ListClustersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListClustersRequest) 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 ListClustersRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListClustersRequest) 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 ListClustersRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListClustersSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListClustersSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListClustersSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListClustersSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListClustersLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetListClustersLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListClustersResponse wrapper for the ListClusters operation +type ListClustersResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ClusterCollection instances + ClusterCollection `presentIn:"body"` + + // 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"` + + // For list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListClustersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListClustersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListClustersSortOrderEnum Enum with underlying type: string +type ListClustersSortOrderEnum string + +// Set of constants representing the allowable values for ListClustersSortOrderEnum +const ( + ListClustersSortOrderAsc ListClustersSortOrderEnum = "ASC" + ListClustersSortOrderDesc ListClustersSortOrderEnum = "DESC" +) + +var mappingListClustersSortOrderEnum = map[string]ListClustersSortOrderEnum{ + "ASC": ListClustersSortOrderAsc, + "DESC": ListClustersSortOrderDesc, +} + +var mappingListClustersSortOrderEnumLowerCase = map[string]ListClustersSortOrderEnum{ + "asc": ListClustersSortOrderAsc, + "desc": ListClustersSortOrderDesc, +} + +// GetListClustersSortOrderEnumValues Enumerates the set of values for ListClustersSortOrderEnum +func GetListClustersSortOrderEnumValues() []ListClustersSortOrderEnum { + values := make([]ListClustersSortOrderEnum, 0) + for _, v := range mappingListClustersSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListClustersSortOrderEnumStringValues Enumerates the set of values in String for ListClustersSortOrderEnum +func GetListClustersSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListClustersSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListClustersSortOrderEnum(val string) (ListClustersSortOrderEnum, bool) { + enum, ok := mappingListClustersSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListClustersSortByEnum Enum with underlying type: string +type ListClustersSortByEnum string + +// Set of constants representing the allowable values for ListClustersSortByEnum +const ( + ListClustersSortByTimecreated ListClustersSortByEnum = "timeCreated" + ListClustersSortByDisplayname ListClustersSortByEnum = "displayName" +) + +var mappingListClustersSortByEnum = map[string]ListClustersSortByEnum{ + "timeCreated": ListClustersSortByTimecreated, + "displayName": ListClustersSortByDisplayname, +} + +var mappingListClustersSortByEnumLowerCase = map[string]ListClustersSortByEnum{ + "timecreated": ListClustersSortByTimecreated, + "displayname": ListClustersSortByDisplayname, +} + +// GetListClustersSortByEnumValues Enumerates the set of values for ListClustersSortByEnum +func GetListClustersSortByEnumValues() []ListClustersSortByEnum { + values := make([]ListClustersSortByEnum, 0) + for _, v := range mappingListClustersSortByEnum { + values = append(values, v) + } + return values +} + +// GetListClustersSortByEnumStringValues Enumerates the set of values in String for ListClustersSortByEnum +func GetListClustersSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListClustersSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListClustersSortByEnum(val string) (ListClustersSortByEnum, bool) { + enum, ok := mappingListClustersSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListClustersLifecycleStateEnum Enum with underlying type: string +type ListClustersLifecycleStateEnum string + +// Set of constants representing the allowable values for ListClustersLifecycleStateEnum +const ( + ListClustersLifecycleStateCreating ListClustersLifecycleStateEnum = "CREATING" + ListClustersLifecycleStateUpdating ListClustersLifecycleStateEnum = "UPDATING" + ListClustersLifecycleStateActive ListClustersLifecycleStateEnum = "ACTIVE" + ListClustersLifecycleStateDeleting ListClustersLifecycleStateEnum = "DELETING" + ListClustersLifecycleStateDeleted ListClustersLifecycleStateEnum = "DELETED" + ListClustersLifecycleStateFailed ListClustersLifecycleStateEnum = "FAILED" +) + +var mappingListClustersLifecycleStateEnum = map[string]ListClustersLifecycleStateEnum{ + "CREATING": ListClustersLifecycleStateCreating, + "UPDATING": ListClustersLifecycleStateUpdating, + "ACTIVE": ListClustersLifecycleStateActive, + "DELETING": ListClustersLifecycleStateDeleting, + "DELETED": ListClustersLifecycleStateDeleted, + "FAILED": ListClustersLifecycleStateFailed, +} + +var mappingListClustersLifecycleStateEnumLowerCase = map[string]ListClustersLifecycleStateEnum{ + "creating": ListClustersLifecycleStateCreating, + "updating": ListClustersLifecycleStateUpdating, + "active": ListClustersLifecycleStateActive, + "deleting": ListClustersLifecycleStateDeleting, + "deleted": ListClustersLifecycleStateDeleted, + "failed": ListClustersLifecycleStateFailed, +} + +// GetListClustersLifecycleStateEnumValues Enumerates the set of values for ListClustersLifecycleStateEnum +func GetListClustersLifecycleStateEnumValues() []ListClustersLifecycleStateEnum { + values := make([]ListClustersLifecycleStateEnum, 0) + for _, v := range mappingListClustersLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListClustersLifecycleStateEnumStringValues Enumerates the set of values in String for ListClustersLifecycleStateEnum +func GetListClustersLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingListClustersLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListClustersLifecycleStateEnum(val string) (ListClustersLifecycleStateEnum, bool) { + enum, ok := mappingListClustersLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/ocvp/list_esxi_hosts_request_response.go b/ocvp/list_esxi_hosts_request_response.go index ac8c52c0f8..4f74f0b1bd 100644 --- a/ocvp/list_esxi_hosts_request_response.go +++ b/ocvp/list_esxi_hosts_request_response.go @@ -21,6 +21,9 @@ type ListEsxiHostsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC. SddcId *string `mandatory:"false" contributesTo:"query" name:"sddcId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster. + ClusterId *string `mandatory:"false" contributesTo:"query" name:"clusterId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Compute instance. ComputeInstanceId *string `mandatory:"false" contributesTo:"query" name:"computeInstanceId"` diff --git a/ocvp/list_supported_skus_request_response.go b/ocvp/list_supported_commitments_request_response.go similarity index 75% rename from ocvp/list_supported_skus_request_response.go rename to ocvp/list_supported_commitments_request_response.go index aa2bd99ee1..945209dfbd 100644 --- a/ocvp/list_supported_skus_request_response.go +++ b/ocvp/list_supported_commitments_request_response.go @@ -11,12 +11,12 @@ import ( "strings" ) -// ListSupportedSkusRequest wrapper for the ListSupportedSkus operation +// ListSupportedCommitmentsRequest wrapper for the ListSupportedCommitments operation // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListSupportedSkus.go.html to see an example of how to use ListSupportedSkusRequest. -type ListSupportedSkusRequest struct { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListSupportedCommitments.go.html to see an example of how to use ListSupportedCommitmentsRequest. +type ListSupportedCommitmentsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` @@ -43,12 +43,12 @@ type ListSupportedSkusRequest struct { RequestMetadata common.RequestMetadata } -func (request ListSupportedSkusRequest) String() string { +func (request ListSupportedCommitmentsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface -func (request ListSupportedSkusRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { +func (request ListSupportedCommitmentsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { _, err := request.ValidateEnumValue() if err != nil { @@ -58,21 +58,21 @@ func (request ListSupportedSkusRequest) HTTPRequest(method, path string, binaryR } // BinaryRequestBody implements the OCIRequest interface -func (request ListSupportedSkusRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { +func (request ListSupportedCommitmentsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { return nil, false } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. -func (request ListSupportedSkusRequest) RetryPolicy() *common.RetryPolicy { +func (request ListSupportedCommitmentsRequest) 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 ListSupportedSkusRequest) ValidateEnumValue() (bool, error) { +func (request ListSupportedCommitmentsRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) @@ -80,14 +80,14 @@ func (request ListSupportedSkusRequest) ValidateEnumValue() (bool, error) { return false, nil } -// ListSupportedSkusResponse wrapper for the ListSupportedSkus operation -type ListSupportedSkusResponse struct { +// ListSupportedCommitmentsResponse wrapper for the ListSupportedCommitments operation +type ListSupportedCommitmentsResponse struct { // The underlying http response RawResponse *http.Response - // A list of SupportedSkuSummaryCollection instances - SupportedSkuSummaryCollection `presentIn:"body"` + // A list of SupportedCommitmentSummaryCollection instances + SupportedCommitmentSummaryCollection `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. @@ -99,11 +99,11 @@ type ListSupportedSkusResponse struct { OpcNextPage *string `presentIn:"header" name:"opc-next-page"` } -func (response ListSupportedSkusResponse) String() string { +func (response ListSupportedCommitmentsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface -func (response ListSupportedSkusResponse) HTTPResponse() *http.Response { +func (response ListSupportedCommitmentsResponse) HTTPResponse() *http.Response { return response.RawResponse } diff --git a/ocvp/list_supported_host_shapes_request_response.go b/ocvp/list_supported_host_shapes_request_response.go index c113571133..027cae9e59 100644 --- a/ocvp/list_supported_host_shapes_request_response.go +++ b/ocvp/list_supported_host_shapes_request_response.go @@ -38,8 +38,11 @@ type ListSupportedHostShapesRequest struct { // A filter to return only resources that match the given name exactly. Name *string `mandatory:"false" contributesTo:"query" name:"name"` - // A filter to return only resources that match the given SDDC type exactly. - SddcType ListSupportedHostShapesSddcTypeEnum `mandatory:"false" contributesTo:"query" name:"sddcType" omitEmpty:"true"` + // A filter to return only resources that support single host SDDC. + IsSingleHostSddcSupported *bool `mandatory:"false" contributesTo:"query" name:"isSingleHostSddcSupported"` + + // A filter to return only the shapes compatible with the initial host shape of the Cluster. + InitialHostShapeName *string `mandatory:"false" contributesTo:"query" name:"initialHostShapeName"` // 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. @@ -77,9 +80,6 @@ func (request ListSupportedHostShapesRequest) RetryPolicy() *common.RetryPolicy // Not recommended for calling this function directly func (request ListSupportedHostShapesRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingListSupportedHostShapesSddcTypeEnum(string(request.SddcType)); !ok && request.SddcType != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SddcType: %s. Supported values are: %s.", request.SddcType, strings.Join(GetListSupportedHostShapesSddcTypeEnumStringValues(), ","))) - } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -113,45 +113,3 @@ func (response ListSupportedHostShapesResponse) String() string { func (response ListSupportedHostShapesResponse) HTTPResponse() *http.Response { return response.RawResponse } - -// ListSupportedHostShapesSddcTypeEnum Enum with underlying type: string -type ListSupportedHostShapesSddcTypeEnum string - -// Set of constants representing the allowable values for ListSupportedHostShapesSddcTypeEnum -const ( - ListSupportedHostShapesSddcTypeProduction ListSupportedHostShapesSddcTypeEnum = "PRODUCTION" - ListSupportedHostShapesSddcTypeNonProduction ListSupportedHostShapesSddcTypeEnum = "NON_PRODUCTION" -) - -var mappingListSupportedHostShapesSddcTypeEnum = map[string]ListSupportedHostShapesSddcTypeEnum{ - "PRODUCTION": ListSupportedHostShapesSddcTypeProduction, - "NON_PRODUCTION": ListSupportedHostShapesSddcTypeNonProduction, -} - -var mappingListSupportedHostShapesSddcTypeEnumLowerCase = map[string]ListSupportedHostShapesSddcTypeEnum{ - "production": ListSupportedHostShapesSddcTypeProduction, - "non_production": ListSupportedHostShapesSddcTypeNonProduction, -} - -// GetListSupportedHostShapesSddcTypeEnumValues Enumerates the set of values for ListSupportedHostShapesSddcTypeEnum -func GetListSupportedHostShapesSddcTypeEnumValues() []ListSupportedHostShapesSddcTypeEnum { - values := make([]ListSupportedHostShapesSddcTypeEnum, 0) - for _, v := range mappingListSupportedHostShapesSddcTypeEnum { - values = append(values, v) - } - return values -} - -// GetListSupportedHostShapesSddcTypeEnumStringValues Enumerates the set of values in String for ListSupportedHostShapesSddcTypeEnum -func GetListSupportedHostShapesSddcTypeEnumStringValues() []string { - return []string{ - "PRODUCTION", - "NON_PRODUCTION", - } -} - -// GetMappingListSupportedHostShapesSddcTypeEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingListSupportedHostShapesSddcTypeEnum(val string) (ListSupportedHostShapesSddcTypeEnum, bool) { - enum, ok := mappingListSupportedHostShapesSddcTypeEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/ocvp/list_supported_vmware_software_versions_request_response.go b/ocvp/list_supported_vmware_software_versions_request_response.go index 199a8a1f37..3fba3a52ad 100644 --- a/ocvp/list_supported_vmware_software_versions_request_response.go +++ b/ocvp/list_supported_vmware_software_versions_request_response.go @@ -35,6 +35,12 @@ type ListSupportedVmwareSoftwareVersionsRequest struct { // request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // A filter to return only resources that match the given VMware software version exactly. + Version *string `mandatory:"false" contributesTo:"query" name:"version"` + + // A filter to return only resources that match or support the given ESXi host shape. + HostShapeName *string `mandatory:"false" contributesTo:"query" name:"hostShapeName"` + // 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 diff --git a/ocvp/network_configuration.go b/ocvp/network_configuration.go new file mode 100644 index 0000000000..b9791bc924 --- /dev/null +++ b/ocvp/network_configuration.go @@ -0,0 +1,158 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NetworkConfiguration The network configurations used by Cluster, including +// OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the management subnet and VLANs. +type NetworkConfiguration struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the management subnet used + // to provision the Cluster. + ProvisioningSubnetId *string `mandatory:"true" json:"provisioningSubnetId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster + // for the vMotion component of the VMware environment. + // This attribute is not guaranteed to reflect the vMotion VLAN + // currently used by the ESXi hosts in the Cluster. The purpose + // of this attribute is to show the vMotion VLAN that the Oracle + // Cloud VMware Solution will use for any new ESXi hosts that you *add to this + // Cluster in the future* with CreateEsxiHost. + // Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN + // for the vMotion component of the VMware environment, you + // should use UpdateCluster to update the Cluster's + // `vmotionVlanId` with that new VLAN's OCID. + VmotionVlanId *string `mandatory:"true" json:"vmotionVlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster + // for the vSAN component of the VMware environment. + // This attribute is not guaranteed to reflect the vSAN VLAN + // currently used by the ESXi hosts in the Cluster. The purpose + // of this attribute is to show the vSAN VLAN that the Oracle + // Cloud VMware Solution will use for any new ESXi hosts that you *add to this + // Cluster in the future* with CreateEsxiHost. + // Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN + // for the vSAN component of the VMware environment, you + // should use UpdateCluster to update the Cluster's + // `vsanVlanId` with that new VLAN's OCID. + VsanVlanId *string `mandatory:"true" json:"vsanVlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster + // for the NSX VTEP component of the VMware environment. + // This attribute is not guaranteed to reflect the NSX VTEP VLAN + // currently used by the ESXi hosts in the Cluster. The purpose + // of this attribute is to show the NSX VTEP VLAN that the Oracle + // Cloud VMware Solution will use for any new ESXi hosts that you *add to this + // Cluster in the future* with CreateEsxiHost. + // Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN + // for the NSX VTEP component of the VMware environment, you + // should use UpdateCluster to update the Cluster's + // `nsxVTepVlanId` with that new VLAN's OCID. + NsxVTepVlanId *string `mandatory:"true" json:"nsxVTepVlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster + // for the NSX Edge VTEP component of the VMware environment. + // This attribute is not guaranteed to reflect the NSX Edge VTEP VLAN + // currently used by the ESXi hosts in the Cluster. The purpose + // of this attribute is to show the NSX Edge VTEP VLAN that the Oracle + // Cloud VMware Solution will use for any new ESXi hosts that you *add to this + // Cluster in the future* with CreateEsxiHost. + // Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN + // for the NSX Edge VTEP component of the VMware environment, you + // should use UpdateCluster to update the Cluster's + // `nsxEdgeVTepVlanId` with that new VLAN's OCID. + NsxEdgeVTepVlanId *string `mandatory:"true" json:"nsxEdgeVTepVlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC + // for the vSphere component of the VMware environment. This VLAN is a mandatory attribute + // for Management Cluster. + // This attribute is not guaranteed to reflect the vSphere VLAN + // currently used by the ESXi hosts in the Cluster. The purpose + // of this attribute is to show the vSphere VLAN that the Oracle + // Cloud VMware Solution will use for any new ESXi hosts that you *add to this + // Cluster in the future* with CreateEsxiHost. + // Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN + // for the vSphere component of the VMware environment, you + // should use UpdateSddc to update the Cluster's + // `vsphereVlanId` with that new VLAN's OCID. + VsphereVlanId *string `mandatory:"false" json:"vsphereVlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC + // for the NSX Edge Uplink 1 component of the VMware environment. This VLAN is a mandatory + // attribute for Management Cluster. + // This attribute is not guaranteed to reflect the NSX Edge Uplink 1 VLAN + // currently used by the ESXi hosts in the Cluster. The purpose + // of this attribute is to show the NSX Edge Uplink 1 VLAN that the Oracle + // Cloud VMware Solution will use for any new ESXi hosts that you *add to this + // Cluster in the future* with CreateEsxiHost. + // Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN + // for the NSX Edge Uplink 1 component of the VMware environment, you + // should use UpdateCluster to update the Cluster's + // `nsxEdgeUplink1VlanId` with that new VLAN's OCID. + NsxEdgeUplink1VlanId *string `mandatory:"false" json:"nsxEdgeUplink1VlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC + // for the NSX Edge Uplink 2 component of the VMware environment. This VLAN is a mandatory + // attribute for Management Cluster. + // This attribute is not guaranteed to reflect the NSX Edge Uplink 2 VLAN + // currently used by the ESXi hosts in the Cluster. The purpose + // of this attribute is to show the NSX Edge Uplink 2 VLAN that the Oracle + // Cloud VMware Solution will use for any new ESXi hosts that you *add to this + // Cluster in the future* with CreateEsxiHost. + // Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN + // for the NSX Edge Uplink 2 component of the VMware environment, you + // should use UpdateCluster to update the Cluster's + // `nsxEdgeUplink2VlanId` with that new VLAN's OCID. + NsxEdgeUplink2VlanId *string `mandatory:"false" json:"nsxEdgeUplink2VlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster + // for the vSphere Replication component of the VMware environment. + ReplicationVlanId *string `mandatory:"false" json:"replicationVlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster + // for the Provisioning component of the VMware environment. + ProvisioningVlanId *string `mandatory:"false" json:"provisioningVlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC + // for the HCX component of the VMware environment. This VLAN is a mandatory attribute + // for Management Cluster when HCX is enabled. + // This attribute is not guaranteed to reflect the HCX VLAN + // currently used by the ESXi hosts in the SDDC. The purpose + // of this attribute is to show the HCX VLAN that the Oracle + // Cloud VMware Solution will use for any new ESXi hosts that you *add to this + // SDDC in the future* with CreateEsxiHost. + // Therefore, if you change the existing ESXi hosts in the SDDC to use a different VLAN + // for the HCX component of the VMware environment, you + // should use UpdateSddc to update the SDDC's + // `hcxVlanId` with that new VLAN's OCID. + HcxVlanId *string `mandatory:"false" json:"hcxVlanId"` +} + +func (m NetworkConfiguration) String() string { + return common.PointerString(m) +} + +// 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 (m NetworkConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/ocvp_cluster_client.go b/ocvp/ocvp_cluster_client.go new file mode 100644 index 0000000000..eb0fd02cf4 --- /dev/null +++ b/ocvp/ocvp_cluster_client.go @@ -0,0 +1,398 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ClusterClient a client for Cluster +type ClusterClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewClusterClientWithConfigurationProvider Creates a new default Cluster client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewClusterClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ClusterClient, err error) { + if enabled := common.CheckForEnabledServices("ocvp"); !enabled { + return client, fmt.Errorf("the Alloy configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local alloy_config file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newClusterClientFromBaseClient(baseClient, provider) +} + +// NewClusterClientWithOboToken Creates a new default Cluster client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewClusterClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ClusterClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newClusterClientFromBaseClient(baseClient, configProvider) +} + +func newClusterClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ClusterClient, err error) { + // Cluster service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Cluster")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ClusterClient{BaseClient: baseClient} + client.BasePath = "20230701" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ClusterClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("ocvp", "https://ocvps.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ClusterClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *ClusterClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateCluster Create a vSphere Cluster in software-defined data center (SDDC). +// Use the WorkRequest operations to track the +// creation of the Cluster. +// **Important:** You must configure the Cluster's networking resources with the security rules detailed in Security Rules for Oracle Cloud VMware Solution SDDCs (https://docs.cloud.oracle.com/iaas/Content/VMware/Reference/ocvssecurityrules.htm). Otherwise, provisioning the SDDC will fail. The rules are based on the requirements set by VMware. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/CreateCluster.go.html to see an example of how to use CreateCluster API. +// A default retry strategy applies to this operation CreateCluster() +func (client ClusterClient) CreateCluster(ctx context.Context, request CreateClusterRequest) (response CreateClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.createCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateClusterResponse") + } + return +} + +// createCluster implements the OCIOperation interface (enables retrying operations) +func (client ClusterClient) createCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/clusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateClusterResponse + 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/vmware/20230701/Cluster/CreateCluster" + err = common.PostProcessServiceError(err, "Cluster", "CreateCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteCluster Deletes the specified Cluster, along with the other resources that were +// created with the Cluster. For example: the Compute instances, DNS records, +// and so on. +// Use the WorkRequest operations to track the +// deletion of the Cluster. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DeleteCluster.go.html to see an example of how to use DeleteCluster API. +// A default retry strategy applies to this operation DeleteCluster() +func (client ClusterClient) DeleteCluster(ctx context.Context, request DeleteClusterRequest) (response DeleteClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteClusterResponse") + } + return +} + +// deleteCluster implements the OCIOperation interface (enables retrying operations) +func (client ClusterClient) deleteCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/clusters/{clusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteClusterResponse + 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/vmware/20230701/Cluster/DeleteCluster" + err = common.PostProcessServiceError(err, "Cluster", "DeleteCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCluster Gets the specified Cluster's information. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/GetCluster.go.html to see an example of how to use GetCluster API. +// A default retry strategy applies to this operation GetCluster() +func (client ClusterClient) GetCluster(ctx context.Context, request GetClusterRequest) (response GetClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetClusterResponse") + } + return +} + +// getCluster implements the OCIOperation interface (enables retrying operations) +func (client ClusterClient) getCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/clusters/{clusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetClusterResponse + 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/vmware/20230701/Cluster/GetCluster" + err = common.PostProcessServiceError(err, "Cluster", "GetCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListClusters Lists the Clusters in the specified compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListClusters.go.html to see an example of how to use ListClusters API. +// A default retry strategy applies to this operation ListClusters() +func (client ClusterClient) ListClusters(ctx context.Context, request ListClustersRequest) (response ListClustersResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listClusters, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListClustersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListClustersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListClustersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListClustersResponse") + } + return +} + +// listClusters implements the OCIOperation interface (enables retrying operations) +func (client ClusterClient) listClusters(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/clusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListClustersResponse + 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/vmware/20230701/ClusterSummary/ListClusters" + err = common.PostProcessServiceError(err, "Cluster", "ListClusters", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateCluster Updates the specified Cluster. +// **Important:** Updating a Cluster affects only certain attributes in the `Cluster` +// object and does not affect the VMware environment currently running in +// the Cluster. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/UpdateCluster.go.html to see an example of how to use UpdateCluster API. +// A default retry strategy applies to this operation UpdateCluster() +func (client ClusterClient) UpdateCluster(ctx context.Context, request UpdateClusterRequest) (response UpdateClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateClusterResponse") + } + return +} + +// updateCluster implements the OCIOperation interface (enables retrying operations) +func (client ClusterClient) updateCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/clusters/{clusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateClusterResponse + 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/vmware/20230701/Cluster/UpdateCluster" + err = common.PostProcessServiceError(err, "Cluster", "UpdateCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/ocvp/ocvp_esxihost_client.go b/ocvp/ocvp_esxihost_client.go index f9e41c2fe4..7c131a68b0 100644 --- a/ocvp/ocvp_esxihost_client.go +++ b/ocvp/ocvp_esxihost_client.go @@ -61,7 +61,7 @@ func newEsxiHostClientFromBaseClient(baseClient common.BaseClient, configProvide common.ConfigCircuitBreakerFromGlobalVar(&baseClient) client = EsxiHostClient{BaseClient: baseClient} - client.BasePath = "20200501" + client.BasePath = "20230701" err = client.setConfigurationProvider(configProvider) return } @@ -150,7 +150,7 @@ func (client EsxiHostClient) createEsxiHost(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/EsxiHost/CreateEsxiHost" err = common.PostProcessServiceError(err, "EsxiHost", "CreateEsxiHost", apiReferenceLink) return response, err } @@ -218,7 +218,7 @@ func (client EsxiHostClient) deleteEsxiHost(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/DeleteEsxiHost" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/EsxiHost/DeleteEsxiHost" err = common.PostProcessServiceError(err, "EsxiHost", "DeleteEsxiHost", apiReferenceLink) return response, err } @@ -276,7 +276,7 @@ func (client EsxiHostClient) getEsxiHost(ctx context.Context, request common.OCI defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/GetEsxiHost" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/EsxiHost/GetEsxiHost" err = common.PostProcessServiceError(err, "EsxiHost", "GetEsxiHost", apiReferenceLink) return response, err } @@ -285,6 +285,69 @@ func (client EsxiHostClient) getEsxiHost(ctx context.Context, request common.OCI return response, err } +// InplaceUpgrade In-place upgrade a ESXi host. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/InplaceUpgrade.go.html to see an example of how to use InplaceUpgrade API. +// A default retry strategy applies to this operation InplaceUpgrade() +func (client EsxiHostClient) InplaceUpgrade(ctx context.Context, request InplaceUpgradeRequest) (response InplaceUpgradeResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.inplaceUpgrade, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = InplaceUpgradeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = InplaceUpgradeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(InplaceUpgradeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into InplaceUpgradeResponse") + } + return +} + +// inplaceUpgrade implements the OCIOperation interface (enables retrying operations) +func (client EsxiHostClient) inplaceUpgrade(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/esxiHosts/{esxiHostId}/actions/inplaceUpgrade", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response InplaceUpgradeResponse + 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/vmware/20230701/EsxiHost/InplaceUpgrade" + err = common.PostProcessServiceError(err, "EsxiHost", "InplaceUpgrade", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListEsxiHosts Lists the ESXi hosts in the specified SDDC. The list can be filtered // by Compute instance OCID or ESXi display name. // Remember that in terms of implementation, an ESXi host is a Compute instance that @@ -341,7 +404,7 @@ func (client EsxiHostClient) listEsxiHosts(ctx context.Context, request common.O defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHostSummary/ListEsxiHosts" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/EsxiHostSummary/ListEsxiHosts" err = common.PostProcessServiceError(err, "EsxiHost", "ListEsxiHosts", apiReferenceLink) return response, err } @@ -350,6 +413,69 @@ func (client EsxiHostClient) listEsxiHosts(ctx context.Context, request common.O return response, err } +// ReplaceHost Replace a faulty ESXi host whose underlying bare metal is broken +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ReplaceHost.go.html to see an example of how to use ReplaceHost API. +// A default retry strategy applies to this operation ReplaceHost() +func (client EsxiHostClient) ReplaceHost(ctx context.Context, request ReplaceHostRequest) (response ReplaceHostResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.replaceHost, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ReplaceHostResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ReplaceHostResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ReplaceHostResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ReplaceHostResponse") + } + return +} + +// replaceHost implements the OCIOperation interface (enables retrying operations) +func (client EsxiHostClient) replaceHost(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/esxiHosts/{esxiHostId}/actions/replaceHost", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ReplaceHostResponse + 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/vmware/20230701/EsxiHost/ReplaceHost" + err = common.PostProcessServiceError(err, "EsxiHost", "ReplaceHost", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // SwapBilling Swap billing between two Active ESXi hosts. // // # See also @@ -404,7 +530,7 @@ func (client EsxiHostClient) swapBilling(ctx context.Context, request common.OCI defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/SwapBilling" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/EsxiHost/SwapBilling" err = common.PostProcessServiceError(err, "EsxiHost", "SwapBilling", apiReferenceLink) return response, err } @@ -462,7 +588,7 @@ func (client EsxiHostClient) updateEsxiHost(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/UpdateEsxiHost" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/EsxiHost/UpdateEsxiHost" err = common.PostProcessServiceError(err, "EsxiHost", "UpdateEsxiHost", apiReferenceLink) return response, err } diff --git a/ocvp/ocvp_sddc_client.go b/ocvp/ocvp_sddc_client.go index abdba3ceef..ad62c67161 100644 --- a/ocvp/ocvp_sddc_client.go +++ b/ocvp/ocvp_sddc_client.go @@ -61,7 +61,7 @@ func newSddcClientFromBaseClient(baseClient common.BaseClient, configProvider co common.ConfigCircuitBreakerFromGlobalVar(&baseClient) client = SddcClient{BaseClient: baseClient} - client.BasePath = "20200501" + client.BasePath = "20230701" err = client.setConfigurationProvider(configProvider) return } @@ -146,7 +146,7 @@ func (client SddcClient) cancelDowngradeHcx(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/CancelDowngradeHcx" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/Sddc/CancelDowngradeHcx" err = common.PostProcessServiceError(err, "Sddc", "CancelDowngradeHcx", apiReferenceLink) return response, err } @@ -211,7 +211,7 @@ func (client SddcClient) changeSddcCompartment(ctx context.Context, request comm defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/ChangeSddcCompartment" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/Sddc/ChangeSddcCompartment" err = common.PostProcessServiceError(err, "Sddc", "ChangeSddcCompartment", apiReferenceLink) return response, err } @@ -277,7 +277,7 @@ func (client SddcClient) createSddc(ctx context.Context, request common.OCIReque defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/CreateSddc" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/Sddc/CreateSddc" err = common.PostProcessServiceError(err, "Sddc", "CreateSddc", apiReferenceLink) return response, err } @@ -339,7 +339,7 @@ func (client SddcClient) deleteSddc(ctx context.Context, request common.OCIReque defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/DeleteSddc" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/Sddc/DeleteSddc" err = common.PostProcessServiceError(err, "Sddc", "DeleteSddc", apiReferenceLink) return response, err } @@ -406,7 +406,7 @@ func (client SddcClient) downgradeHcx(ctx context.Context, request common.OCIReq defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/DowngradeHcx" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/Sddc/DowngradeHcx" err = common.PostProcessServiceError(err, "Sddc", "DowngradeHcx", apiReferenceLink) return response, err } @@ -464,7 +464,7 @@ func (client SddcClient) getSddc(ctx context.Context, request common.OCIRequest, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/GetSddc" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/Sddc/GetSddc" err = common.PostProcessServiceError(err, "Sddc", "GetSddc", apiReferenceLink) return response, err } @@ -523,7 +523,7 @@ func (client SddcClient) listSddcs(ctx context.Context, request common.OCIReques defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/SddcSummary/ListSddcs" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/SddcSummary/ListSddcs" err = common.PostProcessServiceError(err, "Sddc", "ListSddcs", apiReferenceLink) return response, err } @@ -532,13 +532,13 @@ func (client SddcClient) listSddcs(ctx context.Context, request common.OCIReques return response, err } -// ListSupportedHostShapes Lists supported compute shapes for ESXi hosts. +// ListSupportedCommitments Lists supported Commitments. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListSupportedHostShapes.go.html to see an example of how to use ListSupportedHostShapes API. -// A default retry strategy applies to this operation ListSupportedHostShapes() -func (client SddcClient) ListSupportedHostShapes(ctx context.Context, request ListSupportedHostShapesRequest) (response ListSupportedHostShapesResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListSupportedCommitments.go.html to see an example of how to use ListSupportedCommitments API. +// A default retry strategy applies to this operation ListSupportedCommitments() +func (client SddcClient) ListSupportedCommitments(ctx context.Context, request ListSupportedCommitmentsRequest) (response ListSupportedCommitmentsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -547,42 +547,42 @@ func (client SddcClient) ListSupportedHostShapes(ctx context.Context, request Li if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listSupportedHostShapes, policy) + ociResponse, err = common.Retry(ctx, request, client.listSupportedCommitments, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListSupportedHostShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListSupportedCommitmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListSupportedHostShapesResponse{} + response = ListSupportedCommitmentsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListSupportedHostShapesResponse); ok { + if convertedResponse, ok := ociResponse.(ListSupportedCommitmentsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListSupportedHostShapesResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListSupportedCommitmentsResponse") } return } -// listSupportedHostShapes implements the OCIOperation interface (enables retrying operations) -func (client SddcClient) listSupportedHostShapes(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listSupportedCommitments implements the OCIOperation interface (enables retrying operations) +func (client SddcClient) listSupportedCommitments(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/supportedHostShapes", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/supportedCommitments", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListSupportedHostShapesResponse + var response ListSupportedCommitmentsResponse 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/vmware/20200501/SupportedHostShapeSummary/ListSupportedHostShapes" - err = common.PostProcessServiceError(err, "Sddc", "ListSupportedHostShapes", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/SupportedCommitmentSummary/ListSupportedCommitments" + err = common.PostProcessServiceError(err, "Sddc", "ListSupportedCommitments", apiReferenceLink) return response, err } @@ -590,13 +590,13 @@ func (client SddcClient) listSupportedHostShapes(ctx context.Context, request co return response, err } -// ListSupportedSkus Lists supported SKUs. +// ListSupportedHostShapes Lists supported compute shapes for ESXi hosts. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListSupportedSkus.go.html to see an example of how to use ListSupportedSkus API. -// A default retry strategy applies to this operation ListSupportedSkus() -func (client SddcClient) ListSupportedSkus(ctx context.Context, request ListSupportedSkusRequest) (response ListSupportedSkusResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListSupportedHostShapes.go.html to see an example of how to use ListSupportedHostShapes API. +// A default retry strategy applies to this operation ListSupportedHostShapes() +func (client SddcClient) ListSupportedHostShapes(ctx context.Context, request ListSupportedHostShapesRequest) (response ListSupportedHostShapesResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -605,42 +605,42 @@ func (client SddcClient) ListSupportedSkus(ctx context.Context, request ListSupp if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listSupportedSkus, policy) + ociResponse, err = common.Retry(ctx, request, client.listSupportedHostShapes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListSupportedSkusResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListSupportedHostShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListSupportedSkusResponse{} + response = ListSupportedHostShapesResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListSupportedSkusResponse); ok { + if convertedResponse, ok := ociResponse.(ListSupportedHostShapesResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListSupportedSkusResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListSupportedHostShapesResponse") } return } -// listSupportedSkus implements the OCIOperation interface (enables retrying operations) -func (client SddcClient) listSupportedSkus(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listSupportedHostShapes implements the OCIOperation interface (enables retrying operations) +func (client SddcClient) listSupportedHostShapes(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/supportedSkus", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/supportedHostShapes", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListSupportedSkusResponse + var response ListSupportedHostShapesResponse 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/vmware/20200501/SupportedSkuSummary/ListSupportedSkus" - err = common.PostProcessServiceError(err, "Sddc", "ListSupportedSkus", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/SupportedHostShapeSummary/ListSupportedHostShapes" + err = common.PostProcessServiceError(err, "Sddc", "ListSupportedHostShapes", apiReferenceLink) return response, err } @@ -698,7 +698,7 @@ func (client SddcClient) listSupportedVmwareSoftwareVersions(ctx context.Context defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/SupportedVmwareSoftwareVersionSummary/ListSupportedVmwareSoftwareVersions" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/SupportedVmwareSoftwareVersionSummary/ListSupportedVmwareSoftwareVersions" err = common.PostProcessServiceError(err, "Sddc", "ListSupportedVmwareSoftwareVersions", apiReferenceLink) return response, err } @@ -761,7 +761,7 @@ func (client SddcClient) refreshHcxLicenseStatus(ctx context.Context, request co defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/RefreshHcxLicenseStatus" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/Sddc/RefreshHcxLicenseStatus" err = common.PostProcessServiceError(err, "Sddc", "RefreshHcxLicenseStatus", apiReferenceLink) return response, err } @@ -770,6 +770,69 @@ func (client SddcClient) refreshHcxLicenseStatus(ctx context.Context, request co return response, err } +// RetrievePassword Retrieve the SDDC password. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/RetrievePassword.go.html to see an example of how to use RetrievePassword API. +// A default retry strategy applies to this operation RetrievePassword() +func (client SddcClient) RetrievePassword(ctx context.Context, request RetrievePasswordRequest) (response RetrievePasswordResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.retrievePassword, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RetrievePasswordResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RetrievePasswordResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RetrievePasswordResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RetrievePasswordResponse") + } + return +} + +// retrievePassword implements the OCIOperation interface (enables retrying operations) +func (client SddcClient) retrievePassword(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/sddcs/{sddcId}/actions/retrievePassword", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RetrievePasswordResponse + 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/vmware/20230701/Sddc/RetrievePassword" + err = common.PostProcessServiceError(err, "Sddc", "RetrievePassword", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateSddc Updates the specified SDDC. // **Important:** Updating an SDDC affects only certain attributes in the `Sddc` // object and does not affect the VMware environment currently running in @@ -823,7 +886,7 @@ func (client SddcClient) updateSddc(ctx context.Context, request common.OCIReque defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/UpdateSddc" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/Sddc/UpdateSddc" err = common.PostProcessServiceError(err, "Sddc", "UpdateSddc", apiReferenceLink) return response, err } @@ -886,7 +949,7 @@ func (client SddcClient) upgradeHcx(ctx context.Context, request common.OCIReque defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/UpgradeHcx" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/Sddc/UpgradeHcx" err = common.PostProcessServiceError(err, "Sddc", "UpgradeHcx", apiReferenceLink) return response, err } diff --git a/ocvp/ocvp_workrequest_client.go b/ocvp/ocvp_workrequest_client.go index 6df7e72ef8..1be403fec8 100644 --- a/ocvp/ocvp_workrequest_client.go +++ b/ocvp/ocvp_workrequest_client.go @@ -61,7 +61,7 @@ func newWorkRequestClientFromBaseClient(baseClient common.BaseClient, configProv common.ConfigCircuitBreakerFromGlobalVar(&baseClient) client = WorkRequestClient{BaseClient: baseClient} - client.BasePath = "20200501" + client.BasePath = "20230701" err = client.setConfigurationProvider(configProvider) return } @@ -141,7 +141,7 @@ func (client WorkRequestClient) getWorkRequest(ctx context.Context, request comm defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/WorkRequest/GetWorkRequest" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/WorkRequest/GetWorkRequest" err = common.PostProcessServiceError(err, "WorkRequest", "GetWorkRequest", apiReferenceLink) return response, err } @@ -199,7 +199,7 @@ func (client WorkRequestClient) listWorkRequestErrors(ctx context.Context, reque defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/WorkRequestError/ListWorkRequestErrors" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/WorkRequestError/ListWorkRequestErrors" err = common.PostProcessServiceError(err, "WorkRequest", "ListWorkRequestErrors", apiReferenceLink) return response, err } @@ -257,7 +257,7 @@ func (client WorkRequestClient) listWorkRequestLogs(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/WorkRequestLogEntry/ListWorkRequestLogs" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/WorkRequestLogEntry/ListWorkRequestLogs" err = common.PostProcessServiceError(err, "WorkRequest", "ListWorkRequestLogs", apiReferenceLink) return response, err } @@ -315,7 +315,7 @@ func (client WorkRequestClient) listWorkRequests(ctx context.Context, request co defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20200501/WorkRequest/ListWorkRequests" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/vmware/20230701/WorkRequest/ListWorkRequests" err = common.PostProcessServiceError(err, "WorkRequest", "ListWorkRequests", apiReferenceLink) return response, err } diff --git a/ocvp/operation_types.go b/ocvp/operation_types.go index 59b96d3a10..636758f08d 100644 --- a/ocvp/operation_types.go +++ b/ocvp/operation_types.go @@ -21,6 +21,8 @@ type OperationTypesEnum string const ( OperationTypesCreateSddc OperationTypesEnum = "CREATE_SDDC" OperationTypesDeleteSddc OperationTypesEnum = "DELETE_SDDC" + OperationTypesCreateCluster OperationTypesEnum = "CREATE_CLUSTER" + OperationTypesDeleteCluster OperationTypesEnum = "DELETE_CLUSTER" OperationTypesCreateEsxiHost OperationTypesEnum = "CREATE_ESXI_HOST" OperationTypesDeleteEsxiHost OperationTypesEnum = "DELETE_ESXI_HOST" OperationTypesUpgradeHcx OperationTypesEnum = "UPGRADE_HCX" @@ -28,11 +30,15 @@ const ( OperationTypesCancelDowngradeHcx OperationTypesEnum = "CANCEL_DOWNGRADE_HCX" OperationTypesRefreshHcxLicenseStatus OperationTypesEnum = "REFRESH_HCX_LICENSE_STATUS" OperationTypesSwapBilling OperationTypesEnum = "SWAP_BILLING" + OperationTypesReplaceHost OperationTypesEnum = "REPLACE_HOST" + OperationTypesInPlaceUpgrade OperationTypesEnum = "IN_PLACE_UPGRADE" ) var mappingOperationTypesEnum = map[string]OperationTypesEnum{ "CREATE_SDDC": OperationTypesCreateSddc, "DELETE_SDDC": OperationTypesDeleteSddc, + "CREATE_CLUSTER": OperationTypesCreateCluster, + "DELETE_CLUSTER": OperationTypesDeleteCluster, "CREATE_ESXI_HOST": OperationTypesCreateEsxiHost, "DELETE_ESXI_HOST": OperationTypesDeleteEsxiHost, "UPGRADE_HCX": OperationTypesUpgradeHcx, @@ -40,11 +46,15 @@ var mappingOperationTypesEnum = map[string]OperationTypesEnum{ "CANCEL_DOWNGRADE_HCX": OperationTypesCancelDowngradeHcx, "REFRESH_HCX_LICENSE_STATUS": OperationTypesRefreshHcxLicenseStatus, "SWAP_BILLING": OperationTypesSwapBilling, + "REPLACE_HOST": OperationTypesReplaceHost, + "IN_PLACE_UPGRADE": OperationTypesInPlaceUpgrade, } var mappingOperationTypesEnumLowerCase = map[string]OperationTypesEnum{ "create_sddc": OperationTypesCreateSddc, "delete_sddc": OperationTypesDeleteSddc, + "create_cluster": OperationTypesCreateCluster, + "delete_cluster": OperationTypesDeleteCluster, "create_esxi_host": OperationTypesCreateEsxiHost, "delete_esxi_host": OperationTypesDeleteEsxiHost, "upgrade_hcx": OperationTypesUpgradeHcx, @@ -52,6 +62,8 @@ var mappingOperationTypesEnumLowerCase = map[string]OperationTypesEnum{ "cancel_downgrade_hcx": OperationTypesCancelDowngradeHcx, "refresh_hcx_license_status": OperationTypesRefreshHcxLicenseStatus, "swap_billing": OperationTypesSwapBilling, + "replace_host": OperationTypesReplaceHost, + "in_place_upgrade": OperationTypesInPlaceUpgrade, } // GetOperationTypesEnumValues Enumerates the set of values for OperationTypesEnum @@ -68,6 +80,8 @@ func GetOperationTypesEnumStringValues() []string { return []string{ "CREATE_SDDC", "DELETE_SDDC", + "CREATE_CLUSTER", + "DELETE_CLUSTER", "CREATE_ESXI_HOST", "DELETE_ESXI_HOST", "UPGRADE_HCX", @@ -75,6 +89,8 @@ func GetOperationTypesEnumStringValues() []string { "CANCEL_DOWNGRADE_HCX", "REFRESH_HCX_LICENSE_STATUS", "SWAP_BILLING", + "REPLACE_HOST", + "IN_PLACE_UPGRADE", } } diff --git a/ocvp/password_types.go b/ocvp/password_types.go new file mode 100644 index 0000000000..9c4a338653 --- /dev/null +++ b/ocvp/password_types.go @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "strings" +) + +// PasswordTypesEnum Enum with underlying type: string +type PasswordTypesEnum string + +// Set of constants representing the allowable values for PasswordTypesEnum +const ( + PasswordTypesVcenter PasswordTypesEnum = "VCENTER" + PasswordTypesNsx PasswordTypesEnum = "NSX" + PasswordTypesHcx PasswordTypesEnum = "HCX" +) + +var mappingPasswordTypesEnum = map[string]PasswordTypesEnum{ + "VCENTER": PasswordTypesVcenter, + "NSX": PasswordTypesNsx, + "HCX": PasswordTypesHcx, +} + +var mappingPasswordTypesEnumLowerCase = map[string]PasswordTypesEnum{ + "vcenter": PasswordTypesVcenter, + "nsx": PasswordTypesNsx, + "hcx": PasswordTypesHcx, +} + +// GetPasswordTypesEnumValues Enumerates the set of values for PasswordTypesEnum +func GetPasswordTypesEnumValues() []PasswordTypesEnum { + values := make([]PasswordTypesEnum, 0) + for _, v := range mappingPasswordTypesEnum { + values = append(values, v) + } + return values +} + +// GetPasswordTypesEnumStringValues Enumerates the set of values in String for PasswordTypesEnum +func GetPasswordTypesEnumStringValues() []string { + return []string{ + "VCENTER", + "NSX", + "HCX", + } +} + +// GetMappingPasswordTypesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPasswordTypesEnum(val string) (PasswordTypesEnum, bool) { + enum, ok := mappingPasswordTypesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/ocvp/replace_host_details.go b/ocvp/replace_host_details.go new file mode 100644 index 0000000000..48cf460713 --- /dev/null +++ b/ocvp/replace_host_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReplaceHostDetails The details for replacing ESXi host. +type ReplaceHostDetails struct { + + // The ESXi software bundle to install on the ESXi host. + // Only versions under the same vmwareSoftwareVersion and have been validate by Oracle Cloud VMware Solution will be accepted. + // To get a list of the available versions, use + // ListSupportedVmwareSoftwareVersions. + EsxiSoftwareVersion *string `mandatory:"false" json:"esxiSoftwareVersion"` +} + +func (m ReplaceHostDetails) String() string { + return common.PointerString(m) +} + +// 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 (m ReplaceHostDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/replace_host_request_response.go b/ocvp/replace_host_request_response.go new file mode 100644 index 0000000000..38464f3fcd --- /dev/null +++ b/ocvp/replace_host_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2023, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ReplaceHostRequest wrapper for the ReplaceHost operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ReplaceHost.go.html to see an example of how to use ReplaceHostRequest. +type ReplaceHostRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the ESXi host. + EsxiHostId *string `mandatory:"true" contributesTo:"path" name:"esxiHostId"` + + // The details for replacing ESXi host + ReplaceHostDetails `contributesTo:"body"` + + // 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"` + + // 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"` + + // Unique identifier for the request. If you need to contact Oracle about a particular + // request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 ReplaceHostRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ReplaceHostRequest) 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 ReplaceHostRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ReplaceHostRequest) 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 ReplaceHostRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ReplaceHostResponse wrapper for the ReplaceHost operation +type ReplaceHostResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + 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 ReplaceHostResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ReplaceHostResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ocvp/retrieve_password_request_response.go b/ocvp/retrieve_password_request_response.go new file mode 100644 index 0000000000..e53469ff04 --- /dev/null +++ b/ocvp/retrieve_password_request_response.go @@ -0,0 +1,160 @@ +// Copyright (c) 2016, 2018, 2023, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RetrievePasswordRequest wrapper for the RetrievePassword operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/RetrievePassword.go.html to see an example of how to use RetrievePasswordRequest. +type RetrievePasswordRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC. + SddcId *string `mandatory:"true" contributesTo:"path" name:"sddcId"` + + // The SDDC password type. + Type RetrievePasswordTypeEnum `mandatory:"true" contributesTo:"query" name:"type" omitEmpty:"true"` + + // 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"` + + // Unique identifier for the request. If you need to contact Oracle about a particular + // request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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"` + + // 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 RetrievePasswordRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RetrievePasswordRequest) 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 RetrievePasswordRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RetrievePasswordRequest) 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 RetrievePasswordRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRetrievePasswordTypeEnum(string(request.Type)); !ok && request.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", request.Type, strings.Join(GetRetrievePasswordTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RetrievePasswordResponse wrapper for the RetrievePassword operation +type RetrievePasswordResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SddcPassword instance + SddcPassword `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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 RetrievePasswordResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RetrievePasswordResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// RetrievePasswordTypeEnum Enum with underlying type: string +type RetrievePasswordTypeEnum string + +// Set of constants representing the allowable values for RetrievePasswordTypeEnum +const ( + RetrievePasswordTypeVcenter RetrievePasswordTypeEnum = "VCENTER" + RetrievePasswordTypeNsx RetrievePasswordTypeEnum = "NSX" + RetrievePasswordTypeHcx RetrievePasswordTypeEnum = "HCX" +) + +var mappingRetrievePasswordTypeEnum = map[string]RetrievePasswordTypeEnum{ + "VCENTER": RetrievePasswordTypeVcenter, + "NSX": RetrievePasswordTypeNsx, + "HCX": RetrievePasswordTypeHcx, +} + +var mappingRetrievePasswordTypeEnumLowerCase = map[string]RetrievePasswordTypeEnum{ + "vcenter": RetrievePasswordTypeVcenter, + "nsx": RetrievePasswordTypeNsx, + "hcx": RetrievePasswordTypeHcx, +} + +// GetRetrievePasswordTypeEnumValues Enumerates the set of values for RetrievePasswordTypeEnum +func GetRetrievePasswordTypeEnumValues() []RetrievePasswordTypeEnum { + values := make([]RetrievePasswordTypeEnum, 0) + for _, v := range mappingRetrievePasswordTypeEnum { + values = append(values, v) + } + return values +} + +// GetRetrievePasswordTypeEnumStringValues Enumerates the set of values in String for RetrievePasswordTypeEnum +func GetRetrievePasswordTypeEnumStringValues() []string { + return []string{ + "VCENTER", + "NSX", + "HCX", + } +} + +// GetMappingRetrievePasswordTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRetrievePasswordTypeEnum(val string) (RetrievePasswordTypeEnum, bool) { + enum, ok := mappingRetrievePasswordTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/ocvp/sddc.go b/ocvp/sddc.go index 99407c047f..1a31591fd0 100644 --- a/ocvp/sddc.go +++ b/ocvp/sddc.go @@ -29,10 +29,6 @@ type Sddc struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC. Id *string `mandatory:"true" json:"id"` - // The availability domain the ESXi hosts are running in. For Multi-AD SDDC, it is `multi-AD`. - // Example: `Uocm:PHX-AD-1`, `multi-AD` - ComputeAvailabilityDomain *string `mandatory:"true" json:"computeAvailabilityDomain"` - // A descriptive name for the SDDC. It must be unique, start with a letter, and contain only letters, digits, // whitespaces, dashes and underscores. // Avoid entering confidential information. @@ -56,8 +52,8 @@ type Sddc struct { // contains the SDDC. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The number of ESXi hosts in the SDDC. - EsxiHostsCount *int `mandatory:"true" json:"esxiHostsCount"` + // The number of Clusters in the SDDC. + ClustersCount *int `mandatory:"true" json:"clustersCount"` // The FQDN for vCenter. // Example: `vcenter-my-sddc.sddc.us-phoenix-1.oraclecloud.com` @@ -90,110 +86,16 @@ type Sddc struct { // the SDDC's `sshAuthorizedKeys` with the new public keys. SshAuthorizedKeys *string `mandatory:"true" json:"sshAuthorizedKeys"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the management subnet used - // to provision the SDDC. - ProvisioningSubnetId *string `mandatory:"true" json:"provisioningSubnetId"` + // HCX configuration of the SDDC. + HcxMode HcxModesEnum `mandatory:"true" json:"hcxMode"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the vSphere component of the VMware environment. - // This attribute is not guaranteed to reflect the vSphere VLAN - // currently used by the ESXi hosts in the SDDC. The purpose - // of this attribute is to show the vSphere VLAN that the Oracle - // Cloud VMware Solution will use for any new ESXi hosts that you *add to this - // SDDC in the future* with CreateEsxiHost. - // Therefore, if you change the existing ESXi hosts in the SDDC to use a different VLAN - // for the vSphere component of the VMware environment, you - // should use UpdateSddc to update the SDDC's - // `vsphereVlanId` with that new VLAN's OCID. - VsphereVlanId *string `mandatory:"true" json:"vsphereVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the vMotion component of the VMware environment. - // This attribute is not guaranteed to reflect the vMotion VLAN - // currently used by the ESXi hosts in the SDDC. The purpose - // of this attribute is to show the vMotion VLAN that the Oracle - // Cloud VMware Solution will use for any new ESXi hosts that you *add to this - // SDDC in the future* with CreateEsxiHost. - // Therefore, if you change the existing ESXi hosts in the SDDC to use a different VLAN - // for the vMotion component of the VMware environment, you - // should use UpdateSddc to update the SDDC's - // `vmotionVlanId` with that new VLAN's OCID. - VmotionVlanId *string `mandatory:"true" json:"vmotionVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the vSAN component of the VMware environment. - // This attribute is not guaranteed to reflect the vSAN VLAN - // currently used by the ESXi hosts in the SDDC. The purpose - // of this attribute is to show the vSAN VLAN that the Oracle - // Cloud VMware Solution will use for any new ESXi hosts that you *add to this - // SDDC in the future* with CreateEsxiHost. - // Therefore, if you change the existing ESXi hosts in the SDDC to use a different VLAN - // for the vSAN component of the VMware environment, you - // should use UpdateSddc to update the SDDC's - // `vsanVlanId` with that new VLAN's OCID. - VsanVlanId *string `mandatory:"true" json:"vsanVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the NSX VTEP component of the VMware environment. - // This attribute is not guaranteed to reflect the NSX VTEP VLAN - // currently used by the ESXi hosts in the SDDC. The purpose - // of this attribute is to show the NSX VTEP VLAN that the Oracle - // Cloud VMware Solution will use for any new ESXi hosts that you *add to this - // SDDC in the future* with CreateEsxiHost. - // Therefore, if you change the existing ESXi hosts in the SDDC to use a different VLAN - // for the NSX VTEP component of the VMware environment, you - // should use UpdateSddc to update the SDDC's - // `nsxVTepVlanId` with that new VLAN's OCID. - NsxVTepVlanId *string `mandatory:"true" json:"nsxVTepVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the NSX Edge VTEP component of the VMware environment. - // This attribute is not guaranteed to reflect the NSX Edge VTEP VLAN - // currently used by the ESXi hosts in the SDDC. The purpose - // of this attribute is to show the NSX Edge VTEP VLAN that the Oracle - // Cloud VMware Solution will use for any new ESXi hosts that you *add to this - // SDDC in the future* with CreateEsxiHost. - // Therefore, if you change the existing ESXi hosts in the SDDC to use a different VLAN - // for the NSX Edge VTEP component of the VMware environment, you - // should use UpdateSddc to update the SDDC's - // `nsxEdgeVTepVlanId` with that new VLAN's OCID. - NsxEdgeVTepVlanId *string `mandatory:"true" json:"nsxEdgeVTepVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the NSX Edge Uplink 1 component of the VMware environment. - // This attribute is not guaranteed to reflect the NSX Edge Uplink 1 VLAN - // currently used by the ESXi hosts in the SDDC. The purpose - // of this attribute is to show the NSX Edge Uplink 1 VLAN that the Oracle - // Cloud VMware Solution will use for any new ESXi hosts that you *add to this - // SDDC in the future* with CreateEsxiHost. - // Therefore, if you change the existing ESXi hosts in the SDDC to use a different VLAN - // for the NSX Edge Uplink 1 component of the VMware environment, you - // should use UpdateSddc to update the SDDC's - // `nsxEdgeUplink1VlanId` with that new VLAN's OCID. - NsxEdgeUplink1VlanId *string `mandatory:"true" json:"nsxEdgeUplink1VlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the NSX Edge Uplink 2 component of the VMware environment. - // This attribute is not guaranteed to reflect the NSX Edge Uplink 2 VLAN - // currently used by the ESXi hosts in the SDDC. The purpose - // of this attribute is to show the NSX Edge Uplink 2 VLAN that the Oracle - // Cloud VMware Solution will use for any new ESXi hosts that you *add to this - // SDDC in the future* with CreateEsxiHost. - // Therefore, if you change the existing ESXi hosts in the SDDC to use a different VLAN - // for the NSX Edge Uplink 2 component of the VMware environment, you - // should use UpdateSddc to update the SDDC's - // `nsxEdgeUplink2VlanId` with that new VLAN's OCID. - NsxEdgeUplink2VlanId *string `mandatory:"true" json:"nsxEdgeUplink2VlanId"` + InitialConfiguration *InitialConfiguration `mandatory:"true" json:"initialConfiguration"` // The date and time the SDDC was created, in the format defined by // RFC3339 (https://tools.ietf.org/html/rfc3339). // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The initial compute shape of the SDDC's ESXi hosts. - // ListSupportedHostShapes. - InitialHostShapeName *string `mandatory:"true" json:"initialHostShapeName"` - // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` @@ -204,25 +106,22 @@ type Sddc struct { // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` - // A prefix used in the name of each ESXi host and Compute instance in the SDDC. - // If this isn't set, the SDDC's `displayName` is used as the prefix. - // For example, if the value is `MySDDC`, the ESXi hosts are named `MySDDC-1`, - // `MySDDC-2`, and so on. - InstanceDisplayNamePrefix *string `mandatory:"false" json:"instanceDisplayNamePrefix"` - - // The billing option selected during SDDC creation. - // ListSupportedSkus. - InitialSku SkuEnum `mandatory:"false" json:"initialSku,omitempty"` - - // The SDDC includes an administrator username and initial password for vCenter. Make sure - // to change this initial vCenter password to a different value. - VcenterInitialPassword *string `mandatory:"false" json:"vcenterInitialPassword"` - - // The SDDC includes an administrator username and initial password for NSX Manager. Make sure - // to change this initial NSX Manager password to a different value. - NsxManagerInitialPassword *string `mandatory:"false" json:"nsxManagerInitialPassword"` + // In general, this is a specific version of bundled ESXi software supported by + // Oracle Cloud VMware Solution (see + // ListSupportedVmwareSoftwareVersions). + // This attribute is not guaranteed to reflect the version of + // software currently installed on the ESXi hosts in the SDDC. The purpose + // of this attribute is to show the version of software that the Oracle + // Cloud VMware Solution will install on any new ESXi hosts that you *add to this + // SDDC in the future* with CreateEsxiHost + // unless a different version is configured on the Cluster or ESXi host level. + // Therefore, if you upgrade the existing ESXi hosts in the SDDC to use a newer + // version of bundled ESXi software supported by the Oracle Cloud VMware Solution, you + // should use UpdateSddc to update the SDDC's + // `vmwareSoftwareVersion` with that new version. + EsxiSoftwareVersion *string `mandatory:"false" json:"esxiSoftwareVersion"` - // The SDDC includes an administrator username and initial password for vCenter. You can + // The SDDC includes an administrator username and password for vCenter. You can // change this initial username to a different value in vCenter. VcenterUsername *string `mandatory:"false" json:"vcenterUsername"` @@ -230,28 +129,12 @@ type Sddc struct { // can change this initial username to a different value in NSX Manager. NsxManagerUsername *string `mandatory:"false" json:"nsxManagerUsername"` - // The CIDR block for the IP addresses that VMware VMs in the SDDC use to run application - // workloads. - WorkloadNetworkCidr *string `mandatory:"false" json:"workloadNetworkCidr"` - - // The VMware NSX overlay workload segment to host your application. Connect to workload - // portgroup in vCenter to access this overlay segment. - NsxOverlaySegmentName *string `mandatory:"false" json:"nsxOverlaySegmentName"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the `PrivateIp` object that is // the virtual IP (VIP) for the NSX Edge Uplink. Use this OCID as the route target for // route table rules when setting up connectivity between the SDDC and other networks. // For information about `PrivateIp` objects, see the Core Services API. NsxEdgeUplinkIpId *string `mandatory:"false" json:"nsxEdgeUplinkIpId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the vSphere Replication component of the VMware environment. - ReplicationVlanId *string `mandatory:"false" json:"replicationVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the Provisioning component of the VMware environment. - ProvisioningVlanId *string `mandatory:"false" json:"provisioningVlanId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the `PrivateIp` object that is // the virtual IP (VIP) for HCX Manager. For information about `PrivateIp` objects, see the // Core Services API. @@ -261,34 +144,6 @@ type Sddc struct { // Example: `hcx-my-sddc.sddc.us-phoenix-1.oraclecloud.com` HcxFqdn *string `mandatory:"false" json:"hcxFqdn"` - // The SDDC includes an administrator username and initial password for HCX Manager. Make sure - // to change this initial HCX Manager password to a different value. - HcxInitialPassword *string `mandatory:"false" json:"hcxInitialPassword"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the HCX component of the VMware environment. - // This attribute is not guaranteed to reflect the HCX VLAN - // currently used by the ESXi hosts in the SDDC. The purpose - // of this attribute is to show the HCX VLAN that the Oracle - // Cloud VMware Solution will use for any new ESXi hosts that you *add to this - // SDDC in the future* with CreateEsxiHost. - // Therefore, if you change the existing ESXi hosts in the SDDC to use a different VLAN - // for the HCX component of the VMware environment, you - // should use UpdateSddc to update the SDDC's - // `hcxVlanId` with that new VLAN's OCID. - HcxVlanId *string `mandatory:"false" json:"hcxVlanId"` - - // Indicates whether HCX is enabled for this SDDC. - IsHcxEnabled *bool `mandatory:"false" json:"isHcxEnabled"` - - // The activation keys to use on the on-premises HCX Enterprise appliances you site pair with HCX Manager in your VMware Solution. - // The number of keys provided depends on the HCX license type. HCX Advanced provides 3 activation keys. - // HCX Enterprise provides 10 activation keys. - HcxOnPremKey *string `mandatory:"false" json:"hcxOnPremKey"` - - // Indicates whether HCX Enterprise is enabled for this SDDC. - IsHcxEnterpriseEnabled *bool `mandatory:"false" json:"isHcxEnterpriseEnabled"` - // Indicates whether SDDC is pending downgrade from HCX Enterprise to HCX Advanced. IsHcxPendingDowngrade *bool `mandatory:"false" json:"isHcxPendingDowngrade"` @@ -313,27 +168,6 @@ type Sddc struct { // The current state of the SDDC. LifecycleState LifecycleStatesEnum `mandatory:"false" json:"lifecycleState,omitempty"` - - // The vSphere licenses to use when upgrading the SDDC. - UpgradeLicenses []VsphereLicense `mandatory:"false" json:"upgradeLicenses"` - - // The link to guidance for upgrading vSphere. - VsphereUpgradeGuide *string `mandatory:"false" json:"vsphereUpgradeGuide"` - - // The links to binary objects needed to upgrade vSphere. - VsphereUpgradeObjects []VsphereUpgradeObject `mandatory:"false" json:"vsphereUpgradeObjects"` - - // The initial OCPU count of the SDDC's ESXi hosts. - InitialHostOcpuCount *float32 `mandatory:"false" json:"initialHostOcpuCount"` - - // Indicates whether shielded instance is enabled at the SDDC level. - IsShieldedInstanceEnabled *bool `mandatory:"false" json:"isShieldedInstanceEnabled"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. - CapacityReservationId *string `mandatory:"false" json:"capacityReservationId"` - - // Datastores used for the Sddc. - Datastores []DatastoreSummary `mandatory:"false" json:"datastores"` } func (m Sddc) String() string { @@ -345,10 +179,10 @@ func (m Sddc) String() string { // Not recommended for calling this function directly func (m Sddc) ValidateEnumValue() (bool, error) { errMessage := []string{} - - if _, ok := GetMappingSkuEnum(string(m.InitialSku)); !ok && m.InitialSku != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for InitialSku: %s. Supported values are: %s.", m.InitialSku, strings.Join(GetSkuEnumStringValues(), ","))) + if _, ok := GetMappingHcxModesEnum(string(m.HcxMode)); !ok && m.HcxMode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for HcxMode: %s. Supported values are: %s.", m.HcxMode, strings.Join(GetHcxModesEnumStringValues(), ","))) } + if _, ok := GetMappingLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) } diff --git a/ocvp/sddc_password.go b/ocvp/sddc_password.go new file mode 100644 index 0000000000..ce6947dfad --- /dev/null +++ b/ocvp/sddc_password.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SddcPassword SDDC vCenter/NSX/HCX password. +type SddcPassword struct { + + // SDDC password type. + PasswordType PasswordTypesEnum `mandatory:"true" json:"passwordType"` + + // SDDC vCenter/NSX/HCX password context. + Value *string `mandatory:"true" json:"value"` +} + +func (m SddcPassword) String() string { + return common.PointerString(m) +} + +// 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 (m SddcPassword) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPasswordTypesEnum(string(m.PasswordType)); !ok && m.PasswordType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PasswordType: %s. Supported values are: %s.", m.PasswordType, strings.Join(GetPasswordTypesEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/sddc_summary.go b/ocvp/sddc_summary.go index b30fff7dc6..7442cb860b 100644 --- a/ocvp/sddc_summary.go +++ b/ocvp/sddc_summary.go @@ -23,9 +23,6 @@ type SddcSummary struct { // contains the SDDC. Id *string `mandatory:"true" json:"id"` - // The availability domain that the SDDC's ESXi hosts are running in. For Multi-AD SDDC, it is `multi-AD`. - ComputeAvailabilityDomain *string `mandatory:"true" json:"computeAvailabilityDomain"` - // A descriptive name for the SDDC. It must be unique, start with a letter, and contain only letters, digits, // whitespaces, dashes and underscores. // Avoid entering confidential information. @@ -50,11 +47,7 @@ type SddcSummary struct { CompartmentId *string `mandatory:"true" json:"compartmentId"` // The number of ESXi hosts in the SDDC. - EsxiHostsCount *int `mandatory:"true" json:"esxiHostsCount"` - - // The initial compute shape of the SDDC's ESXi hosts. - // ListSupportedHostShapes. - InitialHostShapeName *string `mandatory:"true" json:"initialHostShapeName"` + ClustersCount *int `mandatory:"true" json:"clustersCount"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). @@ -69,8 +62,8 @@ type SddcSummary struct { // HCX Fully Qualified Domain Name HcxFqdn *string `mandatory:"false" json:"hcxFqdn"` - // Indicates whether HCX is enabled. - IsHcxEnabled *bool `mandatory:"false" json:"isHcxEnabled"` + // HCX configuration of the SDDC. + HcxMode HcxModesEnum `mandatory:"false" json:"hcxMode,omitempty"` // FQDN for vCenter // Example: `vcenter-my-sddc.sddc.us-phoenix-1.oraclecloud.com` @@ -92,12 +85,6 @@ type SddcSummary struct { // The current state of the SDDC. LifecycleState LifecycleStatesEnum `mandatory:"false" json:"lifecycleState,omitempty"` - // Indicates whether shielded instance is enabled at the SDDC level. - IsShieldedInstanceEnabled *bool `mandatory:"false" json:"isShieldedInstanceEnabled"` - - // The initial OCPU count of the SDDC's ESXi hosts. - InitialHostOcpuCount *float32 `mandatory:"false" json:"initialHostOcpuCount"` - // Indicates whether this SDDC is designated for only single ESXi host. IsSingleHostSddc *bool `mandatory:"false" json:"isSingleHostSddc"` } @@ -112,6 +99,9 @@ func (m SddcSummary) String() string { func (m SddcSummary) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingHcxModesEnum(string(m.HcxMode)); !ok && m.HcxMode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for HcxMode: %s. Supported values are: %s.", m.HcxMode, strings.Join(GetHcxModesEnumStringValues(), ","))) + } if _, ok := GetMappingLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) } diff --git a/ocvp/sddc_types.go b/ocvp/sddc_types.go deleted file mode 100644 index 0500d4b009..0000000000 --- a/ocvp/sddc_types.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2016, 2018, 2023, 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. - -// Oracle Cloud VMware Solution API -// -// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. -// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). -// - -package ocvp - -import ( - "strings" -) - -// SddcTypesEnum Enum with underlying type: string -type SddcTypesEnum string - -// Set of constants representing the allowable values for SddcTypesEnum -const ( - SddcTypesProduction SddcTypesEnum = "PRODUCTION" - SddcTypesNonProduction SddcTypesEnum = "NON_PRODUCTION" -) - -var mappingSddcTypesEnum = map[string]SddcTypesEnum{ - "PRODUCTION": SddcTypesProduction, - "NON_PRODUCTION": SddcTypesNonProduction, -} - -var mappingSddcTypesEnumLowerCase = map[string]SddcTypesEnum{ - "production": SddcTypesProduction, - "non_production": SddcTypesNonProduction, -} - -// GetSddcTypesEnumValues Enumerates the set of values for SddcTypesEnum -func GetSddcTypesEnumValues() []SddcTypesEnum { - values := make([]SddcTypesEnum, 0) - for _, v := range mappingSddcTypesEnum { - values = append(values, v) - } - return values -} - -// GetSddcTypesEnumStringValues Enumerates the set of values in String for SddcTypesEnum -func GetSddcTypesEnumStringValues() []string { - return []string{ - "PRODUCTION", - "NON_PRODUCTION", - } -} - -// GetMappingSddcTypesEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingSddcTypesEnum(val string) (SddcTypesEnum, bool) { - enum, ok := mappingSddcTypesEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/ocvp/sku.go b/ocvp/sku.go deleted file mode 100644 index bea993a65f..0000000000 --- a/ocvp/sku.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2016, 2018, 2023, 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. - -// Oracle Cloud VMware Solution API -// -// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. -// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). -// - -package ocvp - -import ( - "strings" -) - -// SkuEnum Enum with underlying type: string -type SkuEnum string - -// Set of constants representing the allowable values for SkuEnum -const ( - SkuHour SkuEnum = "HOUR" - SkuMonth SkuEnum = "MONTH" - SkuOneYear SkuEnum = "ONE_YEAR" - SkuThreeYears SkuEnum = "THREE_YEARS" -) - -var mappingSkuEnum = map[string]SkuEnum{ - "HOUR": SkuHour, - "MONTH": SkuMonth, - "ONE_YEAR": SkuOneYear, - "THREE_YEARS": SkuThreeYears, -} - -var mappingSkuEnumLowerCase = map[string]SkuEnum{ - "hour": SkuHour, - "month": SkuMonth, - "one_year": SkuOneYear, - "three_years": SkuThreeYears, -} - -// GetSkuEnumValues Enumerates the set of values for SkuEnum -func GetSkuEnumValues() []SkuEnum { - values := make([]SkuEnum, 0) - for _, v := range mappingSkuEnum { - values = append(values, v) - } - return values -} - -// GetSkuEnumStringValues Enumerates the set of values in String for SkuEnum -func GetSkuEnumStringValues() []string { - return []string{ - "HOUR", - "MONTH", - "ONE_YEAR", - "THREE_YEARS", - } -} - -// GetMappingSkuEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingSkuEnum(val string) (SkuEnum, bool) { - enum, ok := mappingSkuEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/ocvp/supported_sku_summary.go b/ocvp/supported_commitment_summary.go similarity index 74% rename from ocvp/supported_sku_summary.go rename to ocvp/supported_commitment_summary.go index 01ed3f7121..d07db470d5 100644 --- a/ocvp/supported_sku_summary.go +++ b/ocvp/supported_commitment_summary.go @@ -16,24 +16,24 @@ import ( "strings" ) -// SupportedSkuSummary A specific SKU. -type SupportedSkuSummary struct { +// SupportedCommitmentSummary A specific Commitment. +type SupportedCommitmentSummary struct { - // name of SKU - Name SkuEnum `mandatory:"true" json:"name"` + // name of Commitment + Name CommitmentEnum `mandatory:"true" json:"name"` } -func (m SupportedSkuSummary) String() string { +func (m SupportedCommitmentSummary) String() string { return common.PointerString(m) } // 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 (m SupportedSkuSummary) ValidateEnumValue() (bool, error) { +func (m SupportedCommitmentSummary) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingSkuEnum(string(m.Name)); !ok && m.Name != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Name: %s. Supported values are: %s.", m.Name, strings.Join(GetSkuEnumStringValues(), ","))) + if _, ok := GetMappingCommitmentEnum(string(m.Name)); !ok && m.Name != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Name: %s. Supported values are: %s.", m.Name, strings.Join(GetCommitmentEnumStringValues(), ","))) } if len(errMessage) > 0 { diff --git a/ocvp/supported_commitment_summary_collection.go b/ocvp/supported_commitment_summary_collection.go new file mode 100644 index 0000000000..78291bfa35 --- /dev/null +++ b/ocvp/supported_commitment_summary_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SupportedCommitmentSummaryCollection A specific Commitment. +type SupportedCommitmentSummaryCollection struct { + + // A list of the supported Commitments. + Items []SupportedCommitmentSummary `mandatory:"true" json:"items"` +} + +func (m SupportedCommitmentSummaryCollection) String() string { + return common.PointerString(m) +} + +// 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 (m SupportedCommitmentSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/supported_esxi_software_version_summary.go b/ocvp/supported_esxi_software_version_summary.go new file mode 100644 index 0000000000..aaf1005ab9 --- /dev/null +++ b/ocvp/supported_esxi_software_version_summary.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SupportedEsxiSoftwareVersionSummary A specific version of bundled ESXi software supported by the Oracle Cloud +// VMware Solution. +type SupportedEsxiSoftwareVersionSummary struct { + + // A short, unique string that identifies the version of bundled software. + Version *string `mandatory:"true" json:"version"` + + // A description of the software in the bundle. + Description *string `mandatory:"true" json:"description"` + + // A list of ESXi host shapes supported by the version of bundled software. + SupportedHostShapeNames []string `mandatory:"true" json:"supportedHostShapeNames"` +} + +func (m SupportedEsxiSoftwareVersionSummary) String() string { + return common.PointerString(m) +} + +// 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 (m SupportedEsxiSoftwareVersionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/supported_host_shape_summary.go b/ocvp/supported_host_shape_summary.go index 7f52b4c5cd..d93e50fb9c 100644 --- a/ocvp/supported_host_shape_summary.go +++ b/ocvp/supported_host_shape_summary.go @@ -34,8 +34,8 @@ type SupportedHostShapeSummary struct { // Support OCPU count of the shape. SupportedOcpuCount []float32 `mandatory:"false" json:"supportedOcpuCount"` - // The supported SDDC types for the shape. - SupportedSddcTypes []SddcTypesEnum `mandatory:"false" json:"supportedSddcTypes,omitempty"` + // Indicates whether the shape supports single host SDDCs. + IsSingleHostSddcSupported *bool `mandatory:"false" json:"isSingleHostSddcSupported"` // The VMware software versions supported by the shape. SupportedVmwareSoftwareVersions []string `mandatory:"false" json:"supportedVmwareSoftwareVersions"` @@ -46,8 +46,8 @@ type SupportedHostShapeSummary struct { // Indicates whether the shape supports shielded instances. IsSupportShieldedInstances *bool `mandatory:"false" json:"isSupportShieldedInstances"` - // Whether the shape supports "MONTH" SKU. - IsSupportMonthlySku *bool `mandatory:"false" json:"isSupportMonthlySku"` + // Whether the shape supports "MONTH" Commitment. + IsSupportMonthlyCommitment *bool `mandatory:"false" json:"isSupportMonthlyCommitment"` } func (m SupportedHostShapeSummary) String() string { @@ -65,12 +65,6 @@ func (m SupportedHostShapeSummary) ValidateEnumValue() (bool, error) { } } - for _, val := range m.SupportedSddcTypes { - if _, ok := GetMappingSddcTypesEnum(string(val)); !ok && val != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SupportedSddcTypes: %s. Supported values are: %s.", val, strings.Join(GetSddcTypesEnumStringValues(), ","))) - } - } - if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/ocvp/supported_vmware_software_version_summary.go b/ocvp/supported_vmware_software_version_summary.go index 7f1c4f846a..867f82da77 100644 --- a/ocvp/supported_vmware_software_version_summary.go +++ b/ocvp/supported_vmware_software_version_summary.go @@ -25,6 +25,9 @@ type SupportedVmwareSoftwareVersionSummary struct { // A description of the software in the bundle. Description *string `mandatory:"true" json:"description"` + + // A list of supported ESXi software versions. + EsxiSoftwareVersions []SupportedEsxiSoftwareVersionSummary `mandatory:"false" json:"esxiSoftwareVersions"` } func (m SupportedVmwareSoftwareVersionSummary) String() string { diff --git a/ocvp/update_cluster_details.go b/ocvp/update_cluster_details.go new file mode 100644 index 0000000000..fcbf1681cd --- /dev/null +++ b/ocvp/update_cluster_details.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateClusterDetails The Cluster information to be updated. +// **Important:** Only the `displayName`, `freeFormTags`, and `definedTags` attributes +// affect the existing Cluster. Changing the other attributes affects the `Cluster` object, but not +// the VMware environment currently running on that Cluster. Those other attributes are used +// by the Oracle Cloud VMware Solution *only* for new ESXi hosts that you add to this +// Cluster in the future with CreateEsxiHost. +type UpdateClusterDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster. + // Cluster name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. + DisplayName *string `mandatory:"false" json:"displayName"` + + NetworkConfiguration *NetworkConfiguration `mandatory:"false" json:"networkConfiguration"` + + // The version of bundled VMware software that the Oracle Cloud VMware Solution will + // install on any new ESXi hosts that you add to this Cluster in the future. To get a list of the available versions, use + // ListSupportedVmwareSoftwareVersions. + VmwareSoftwareVersion *string `mandatory:"false" json:"vmwareSoftwareVersion"` + + // The version of bundled ESXi software that the Oracle Cloud VMware Solution will + // install on any new ESXi hosts that you add to this Cluster in the future unless a specific version is configured on the ESXi level. + // To get a list of the available versions, use + // ListSupportedVmwareSoftwareVersions. + EsxiSoftwareVersion *string `mandatory:"false" json:"esxiSoftwareVersion"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateClusterDetails) String() string { + return common.PointerString(m) +} + +// 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 (m UpdateClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/ocvp/update_cluster_request_response.go b/ocvp/update_cluster_request_response.go new file mode 100644 index 0000000000..c4bbb48c6c --- /dev/null +++ b/ocvp/update_cluster_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateClusterRequest wrapper for the UpdateCluster operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/UpdateCluster.go.html to see an example of how to use UpdateClusterRequest. +type UpdateClusterRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster. + ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` + + // The information to be updated. + UpdateClusterDetails `contributesTo:"body"` + + // 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"` + + // Unique identifier for the request. If you need to contact Oracle about a particular + // request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 UpdateClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateClusterRequest) 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 UpdateClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateClusterRequest) 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 UpdateClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateClusterResponse wrapper for the UpdateCluster operation +type UpdateClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Cluster instance + Cluster `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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 UpdateClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/ocvp/update_esxi_host_details.go b/ocvp/update_esxi_host_details.go index 7dcd248538..474ff76ac0 100644 --- a/ocvp/update_esxi_host_details.go +++ b/ocvp/update_esxi_host_details.go @@ -20,14 +20,14 @@ import ( type UpdateEsxiHostDetails struct { // A descriptive name for the ESXi host. It's changeable. - // Esxi Host name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the SDDC. + // Esxi Host name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the Cluster. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // The billing option to switch to after the existing billing cycle ends. - // If `nextSku` is null or empty, `currentSku` continues to the next billing cycle. - // ListSupportedSkus. - NextSku SkuEnum `mandatory:"false" json:"nextSku,omitempty"` + // If `nextCommitment` is null or empty, `currentCommitment` continues to the next billing cycle. + // ListSupportedCommitments. + NextCommitment CommitmentEnum `mandatory:"false" json:"nextCommitment,omitempty"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the deleted ESXi Host with LeftOver billing cycle. BillingDonorHostId *string `mandatory:"false" json:"billingDonorHostId"` @@ -53,8 +53,8 @@ func (m UpdateEsxiHostDetails) String() string { func (m UpdateEsxiHostDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingSkuEnum(string(m.NextSku)); !ok && m.NextSku != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NextSku: %s. Supported values are: %s.", m.NextSku, strings.Join(GetSkuEnumStringValues(), ","))) + if _, ok := GetMappingCommitmentEnum(string(m.NextCommitment)); !ok && m.NextCommitment != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NextCommitment: %s. Supported values are: %s.", m.NextCommitment, strings.Join(GetCommitmentEnumStringValues(), ","))) } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) diff --git a/ocvp/update_sddc_details.go b/ocvp/update_sddc_details.go index 32906f4ad6..40fa03b33b 100644 --- a/ocvp/update_sddc_details.go +++ b/ocvp/update_sddc_details.go @@ -29,58 +29,23 @@ type UpdateSddcDetails struct { DisplayName *string `mandatory:"false" json:"displayName"` // The version of bundled VMware software that the Oracle Cloud VMware Solution will - // install on any new ESXi hosts that you add to this SDDC in the future. + // install on any new ESXi hosts that you add to this SDDC in the future unless a specific version is configured on the Cluster level. // For the list of versions supported by the Oracle Cloud VMware Solution, see // ListSupportedVmwareSoftwareVersions). VmwareSoftwareVersion *string `mandatory:"false" json:"vmwareSoftwareVersion"` + // The version of bundled ESXi software that the Oracle Cloud VMware Solution will + // install on any new ESXi hosts that you add to this SDDC in the future unless a specific version is configured on the Cluster level. + // For the list of versions supported by the Oracle Cloud VMware Solution, see + // ListSupportedVmwareSoftwareVersions). + EsxiSoftwareVersion *string `mandatory:"false" json:"esxiSoftwareVersion"` + // One or more public SSH keys to be included in the `~/.ssh/authorized_keys` file for // the default user on each ESXi host, only when adding new ESXi hosts to this SDDC. // Use a newline character to separate multiple keys. // The SSH keys must be in the format required for the `authorized_keys` file. SshAuthorizedKeys *string `mandatory:"false" json:"sshAuthorizedKeys"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for - // the vSphere component of the VMware environment when adding new ESXi hosts to the SDDC. - VsphereVlanId *string `mandatory:"false" json:"vsphereVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for - // the vMotion component of the VMware environment when adding new ESXi hosts to the SDDC. - VmotionVlanId *string `mandatory:"false" json:"vmotionVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for - // the vSAN component of the VMware environment when adding new ESXi hosts to the SDDC. - VsanVlanId *string `mandatory:"false" json:"vsanVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for - // the NSX VTEP component of the VMware environment when adding new ESXi hosts to the SDDC. - NsxVTepVlanId *string `mandatory:"false" json:"nsxVTepVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for - // the NSX Edge VTEP component of the VMware environment when adding new ESXi hosts to the SDDC. - NsxEdgeVTepVlanId *string `mandatory:"false" json:"nsxEdgeVTepVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for - // the NSX Edge Uplink 1 component of the VMware environment when adding new ESXi hosts to the SDDC. - NsxEdgeUplink1VlanId *string `mandatory:"false" json:"nsxEdgeUplink1VlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for - // the NSX Edge Uplink 2 component of the VMware environment when adding new ESXi hosts to the SDDC. - // **Note:** This VLAN is reserved for future use to deploy public-facing applications on the VMware SDDC. - NsxEdgeUplink2VlanId *string `mandatory:"false" json:"nsxEdgeUplink2VlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the vSphere Replication component of the VMware environment. - ReplicationVlanId *string `mandatory:"false" json:"replicationVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC - // for the Provisioning component of the VMware environment. - ProvisioningVlanId *string `mandatory:"false" json:"provisioningVlanId"` - - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VLAN to use for the HCX - // component of the VMware environment when adding new ESXi hosts to the SDDC. This value can be updated only when `isHcxEnabled` is true. - HcxVlanId *string `mandatory:"false" json:"hcxVlanId"` - // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` diff --git a/ocvp/vsphere_types.go b/ocvp/vsphere_types.go new file mode 100644 index 0000000000..a0adb00239 --- /dev/null +++ b/ocvp/vsphere_types.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "strings" +) + +// VsphereTypesEnum Enum with underlying type: string +type VsphereTypesEnum string + +// Set of constants representing the allowable values for VsphereTypesEnum +const ( + VsphereTypesManagement VsphereTypesEnum = "MANAGEMENT" + VsphereTypesWorkload VsphereTypesEnum = "WORKLOAD" +) + +var mappingVsphereTypesEnum = map[string]VsphereTypesEnum{ + "MANAGEMENT": VsphereTypesManagement, + "WORKLOAD": VsphereTypesWorkload, +} + +var mappingVsphereTypesEnumLowerCase = map[string]VsphereTypesEnum{ + "management": VsphereTypesManagement, + "workload": VsphereTypesWorkload, +} + +// GetVsphereTypesEnumValues Enumerates the set of values for VsphereTypesEnum +func GetVsphereTypesEnumValues() []VsphereTypesEnum { + values := make([]VsphereTypesEnum, 0) + for _, v := range mappingVsphereTypesEnum { + values = append(values, v) + } + return values +} + +// GetVsphereTypesEnumStringValues Enumerates the set of values in String for VsphereTypesEnum +func GetVsphereTypesEnumStringValues() []string { + return []string{ + "MANAGEMENT", + "WORKLOAD", + } +} + +// GetMappingVsphereTypesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingVsphereTypesEnum(val string) (VsphereTypesEnum, bool) { + enum, ok := mappingVsphereTypesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/archival_state.go b/opsi/archival_state.go new file mode 100644 index 0000000000..6b89ed4fd5 --- /dev/null +++ b/opsi/archival_state.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// ArchivalStateEnum Enum with underlying type: string +type ArchivalStateEnum string + +// Set of constants representing the allowable values for ArchivalStateEnum +const ( + ArchivalStateArchived ArchivalStateEnum = "ARCHIVED" + ArchivalStateRestoring ArchivalStateEnum = "RESTORING" + ArchivalStateRestored ArchivalStateEnum = "RESTORED" +) + +var mappingArchivalStateEnum = map[string]ArchivalStateEnum{ + "ARCHIVED": ArchivalStateArchived, + "RESTORING": ArchivalStateRestoring, + "RESTORED": ArchivalStateRestored, +} + +var mappingArchivalStateEnumLowerCase = map[string]ArchivalStateEnum{ + "archived": ArchivalStateArchived, + "restoring": ArchivalStateRestoring, + "restored": ArchivalStateRestored, +} + +// GetArchivalStateEnumValues Enumerates the set of values for ArchivalStateEnum +func GetArchivalStateEnumValues() []ArchivalStateEnum { + values := make([]ArchivalStateEnum, 0) + for _, v := range mappingArchivalStateEnum { + values = append(values, v) + } + return values +} + +// GetArchivalStateEnumStringValues Enumerates the set of values in String for ArchivalStateEnum +func GetArchivalStateEnumStringValues() []string { + return []string{ + "ARCHIVED", + "RESTORING", + "RESTORED", + } +} + +// GetMappingArchivalStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingArchivalStateEnum(val string) (ArchivalStateEnum, bool) { + enum, ok := mappingArchivalStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/awr_hub_objects.go b/opsi/awr_hub_objects.go new file mode 100644 index 0000000000..2884129017 --- /dev/null +++ b/opsi/awr_hub_objects.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AwrHubObjects Logical grouping used for Awr Hub Object operations. +type AwrHubObjects struct { + + // Awr Hub Object. + AwrSnapshots *interface{} `mandatory:"false" json:"awrSnapshots"` +} + +func (m AwrHubObjects) String() string { + return common.PointerString(m) +} + +// 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 (m AwrHubObjects) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/awr_hub_source.go b/opsi/awr_hub_source.go new file mode 100644 index 0000000000..f868fa5761 --- /dev/null +++ b/opsi/awr_hub_source.go @@ -0,0 +1,119 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AwrHubSource Awr hub source object +type AwrHubSource struct { + + // The name of the Awr Hub source database. + Name *string `mandatory:"true" json:"name"` + + // AWR Hub OCID + AwrHubId *string `mandatory:"true" json:"awrHubId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // source type of the database + Type AwrHubSourceTypeEnum `mandatory:"true" json:"type"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Awr Hub source database. + Id *string `mandatory:"true" json:"id"` + + // The shorted string of the Awr Hub source database identifier. + AwrHubOpsiSourceId *string `mandatory:"true" json:"awrHubOpsiSourceId"` + + // Opsi Mailbox URL based on the Awr Hub and Awr Hub source. + SourceMailBoxUrl *string `mandatory:"true" json:"sourceMailBoxUrl"` + + // The time at which the resource was first created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // the current state of the source database + LifecycleState AwrHubSourceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Indicates the status of a source database in Operations Insights + Status AwrHubSourceStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database id. + AssociatedResourceId *string `mandatory:"false" json:"associatedResourceId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database id. + AssociatedOpsiId *string `mandatory:"false" json:"associatedOpsiId"` + + // The time at which the resource was last updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // This is `true` if the source databse is registered with a Awr Hub, otherwise `false` + IsRegisteredWithAwrHub *bool `mandatory:"false" json:"isRegisteredWithAwrHub"` + + // DatabaseId of the Source database for which AWR Data will be uploaded to AWR Hub. + AwrSourceDatabaseId *string `mandatory:"false" json:"awrSourceDatabaseId"` + + // The minimum snapshot identifier of the source database for which AWR data is uploaded to AWR Hub. + MinSnapshotIdentifier *float32 `mandatory:"false" json:"minSnapshotIdentifier"` + + // The maximum snapshot identifier of the source database for which AWR data is uploaded to AWR Hub. + MaxSnapshotIdentifier *float32 `mandatory:"false" json:"maxSnapshotIdentifier"` + + // The time at which the earliest snapshot was generated in the source database for which data is uploaded to AWR Hub. An RFC3339 formatted datetime string + TimeFirstSnapshotGenerated *common.SDKTime `mandatory:"false" json:"timeFirstSnapshotGenerated"` + + // The time at which the latest snapshot was generated in the source database for which data is uploaded to AWR Hub. An RFC3339 formatted datetime string + TimeLastSnapshotGenerated *common.SDKTime `mandatory:"false" json:"timeLastSnapshotGenerated"` + + // Number of hours since last AWR snapshots import happened from the Source database. + HoursSinceLastImport *float64 `mandatory:"false" json:"hoursSinceLastImport"` +} + +func (m AwrHubSource) String() string { + return common.PointerString(m) +} + +// 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 (m AwrHubSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAwrHubSourceTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetAwrHubSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingAwrHubSourceLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetAwrHubSourceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingAwrHubSourceStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetAwrHubSourceStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/awr_hub_source_lifecycle_state.go b/opsi/awr_hub_source_lifecycle_state.go new file mode 100644 index 0000000000..73e0ae90fb --- /dev/null +++ b/opsi/awr_hub_source_lifecycle_state.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// AwrHubSourceLifecycleStateEnum Enum with underlying type: string +type AwrHubSourceLifecycleStateEnum string + +// Set of constants representing the allowable values for AwrHubSourceLifecycleStateEnum +const ( + AwrHubSourceLifecycleStateCreating AwrHubSourceLifecycleStateEnum = "CREATING" + AwrHubSourceLifecycleStateUpdating AwrHubSourceLifecycleStateEnum = "UPDATING" + AwrHubSourceLifecycleStateActive AwrHubSourceLifecycleStateEnum = "ACTIVE" + AwrHubSourceLifecycleStateDeleting AwrHubSourceLifecycleStateEnum = "DELETING" + AwrHubSourceLifecycleStateDeleted AwrHubSourceLifecycleStateEnum = "DELETED" + AwrHubSourceLifecycleStateFailed AwrHubSourceLifecycleStateEnum = "FAILED" +) + +var mappingAwrHubSourceLifecycleStateEnum = map[string]AwrHubSourceLifecycleStateEnum{ + "CREATING": AwrHubSourceLifecycleStateCreating, + "UPDATING": AwrHubSourceLifecycleStateUpdating, + "ACTIVE": AwrHubSourceLifecycleStateActive, + "DELETING": AwrHubSourceLifecycleStateDeleting, + "DELETED": AwrHubSourceLifecycleStateDeleted, + "FAILED": AwrHubSourceLifecycleStateFailed, +} + +var mappingAwrHubSourceLifecycleStateEnumLowerCase = map[string]AwrHubSourceLifecycleStateEnum{ + "creating": AwrHubSourceLifecycleStateCreating, + "updating": AwrHubSourceLifecycleStateUpdating, + "active": AwrHubSourceLifecycleStateActive, + "deleting": AwrHubSourceLifecycleStateDeleting, + "deleted": AwrHubSourceLifecycleStateDeleted, + "failed": AwrHubSourceLifecycleStateFailed, +} + +// GetAwrHubSourceLifecycleStateEnumValues Enumerates the set of values for AwrHubSourceLifecycleStateEnum +func GetAwrHubSourceLifecycleStateEnumValues() []AwrHubSourceLifecycleStateEnum { + values := make([]AwrHubSourceLifecycleStateEnum, 0) + for _, v := range mappingAwrHubSourceLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetAwrHubSourceLifecycleStateEnumStringValues Enumerates the set of values in String for AwrHubSourceLifecycleStateEnum +func GetAwrHubSourceLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingAwrHubSourceLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAwrHubSourceLifecycleStateEnum(val string) (AwrHubSourceLifecycleStateEnum, bool) { + enum, ok := mappingAwrHubSourceLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/awr_hub_source_status.go b/opsi/awr_hub_source_status.go new file mode 100644 index 0000000000..4d38d0071e --- /dev/null +++ b/opsi/awr_hub_source_status.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// AwrHubSourceStatusEnum Enum with underlying type: string +type AwrHubSourceStatusEnum string + +// Set of constants representing the allowable values for AwrHubSourceStatusEnum +const ( + AwrHubSourceStatusAccepting AwrHubSourceStatusEnum = "ACCEPTING" + AwrHubSourceStatusNotAccepting AwrHubSourceStatusEnum = "NOT_ACCEPTING" + AwrHubSourceStatusNotRegistered AwrHubSourceStatusEnum = "NOT_REGISTERED" + AwrHubSourceStatusTerminated AwrHubSourceStatusEnum = "TERMINATED" +) + +var mappingAwrHubSourceStatusEnum = map[string]AwrHubSourceStatusEnum{ + "ACCEPTING": AwrHubSourceStatusAccepting, + "NOT_ACCEPTING": AwrHubSourceStatusNotAccepting, + "NOT_REGISTERED": AwrHubSourceStatusNotRegistered, + "TERMINATED": AwrHubSourceStatusTerminated, +} + +var mappingAwrHubSourceStatusEnumLowerCase = map[string]AwrHubSourceStatusEnum{ + "accepting": AwrHubSourceStatusAccepting, + "not_accepting": AwrHubSourceStatusNotAccepting, + "not_registered": AwrHubSourceStatusNotRegistered, + "terminated": AwrHubSourceStatusTerminated, +} + +// GetAwrHubSourceStatusEnumValues Enumerates the set of values for AwrHubSourceStatusEnum +func GetAwrHubSourceStatusEnumValues() []AwrHubSourceStatusEnum { + values := make([]AwrHubSourceStatusEnum, 0) + for _, v := range mappingAwrHubSourceStatusEnum { + values = append(values, v) + } + return values +} + +// GetAwrHubSourceStatusEnumStringValues Enumerates the set of values in String for AwrHubSourceStatusEnum +func GetAwrHubSourceStatusEnumStringValues() []string { + return []string{ + "ACCEPTING", + "NOT_ACCEPTING", + "NOT_REGISTERED", + "TERMINATED", + } +} + +// GetMappingAwrHubSourceStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAwrHubSourceStatusEnum(val string) (AwrHubSourceStatusEnum, bool) { + enum, ok := mappingAwrHubSourceStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/awr_hub_source_summary.go b/opsi/awr_hub_source_summary.go new file mode 100644 index 0000000000..05ded88f57 --- /dev/null +++ b/opsi/awr_hub_source_summary.go @@ -0,0 +1,119 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AwrHubSourceSummary Awr hub source object +type AwrHubSourceSummary struct { + + // The name of the Awr Hub source database. + Name *string `mandatory:"true" json:"name"` + + // AWR Hub OCID + AwrHubId *string `mandatory:"true" json:"awrHubId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // source type of the database + Type AwrHubSourceTypeEnum `mandatory:"true" json:"type"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Awr Hub source database. + Id *string `mandatory:"true" json:"id"` + + // The shorted string of the Awr Hub source database identifier. + AwrHubOpsiSourceId *string `mandatory:"true" json:"awrHubOpsiSourceId"` + + // Opsi Mailbox URL based on the Awr Hub and Awr Hub source. + SourceMailBoxUrl *string `mandatory:"true" json:"sourceMailBoxUrl"` + + // The time at which the resource was first created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // the current state of the source database + LifecycleState AwrHubSourceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Indicates the status of a source database in Operations Insights + Status AwrHubSourceStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database id. + AssociatedResourceId *string `mandatory:"false" json:"associatedResourceId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database id. + AssociatedOpsiId *string `mandatory:"false" json:"associatedOpsiId"` + + // The time at which the resource was last updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // This is `true` if the source databse is registered with a Awr Hub, otherwise `false` + IsRegisteredWithAwrHub *bool `mandatory:"false" json:"isRegisteredWithAwrHub"` + + // DatabaseId of the Source database for which AWR Data will be uploaded to AWR Hub. + AwrSourceDatabaseId *string `mandatory:"false" json:"awrSourceDatabaseId"` + + // The minimum snapshot identifier of the source database for which AWR data is uploaded to AWR Hub. + MinSnapshotIdentifier *float32 `mandatory:"false" json:"minSnapshotIdentifier"` + + // The maximum snapshot identifier of the source database for which AWR data is uploaded to AWR Hub. + MaxSnapshotIdentifier *float32 `mandatory:"false" json:"maxSnapshotIdentifier"` + + // The time at which the earliest snapshot was generated in the source database for which data is uploaded to AWR Hub. An RFC3339 formatted datetime string + TimeFirstSnapshotGenerated *common.SDKTime `mandatory:"false" json:"timeFirstSnapshotGenerated"` + + // The time at which the latest snapshot was generated in the source database for which data is uploaded to AWR Hub. An RFC3339 formatted datetime string + TimeLastSnapshotGenerated *common.SDKTime `mandatory:"false" json:"timeLastSnapshotGenerated"` + + // Number of hours since last AWR snapshots import happened from the Source database. + HoursSinceLastImport *float64 `mandatory:"false" json:"hoursSinceLastImport"` +} + +func (m AwrHubSourceSummary) String() string { + return common.PointerString(m) +} + +// 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 (m AwrHubSourceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAwrHubSourceTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetAwrHubSourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingAwrHubSourceLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetAwrHubSourceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingAwrHubSourceStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetAwrHubSourceStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/awr_hub_source_summary_collection.go b/opsi/awr_hub_source_summary_collection.go new file mode 100644 index 0000000000..5711eb9ec1 --- /dev/null +++ b/opsi/awr_hub_source_summary_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AwrHubSourceSummaryCollection Collection of Awr Hub sources. +type AwrHubSourceSummaryCollection struct { + + // Array of Awr Hub source objects. + Items []AwrHubSourceSummary `mandatory:"true" json:"items"` +} + +func (m AwrHubSourceSummaryCollection) String() string { + return common.PointerString(m) +} + +// 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 (m AwrHubSourceSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/awr_hub_source_type.go b/opsi/awr_hub_source_type.go new file mode 100644 index 0000000000..2fce25bcdb --- /dev/null +++ b/opsi/awr_hub_source_type.go @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// AwrHubSourceTypeEnum Enum with underlying type: string +type AwrHubSourceTypeEnum string + +// Set of constants representing the allowable values for AwrHubSourceTypeEnum +const ( + AwrHubSourceTypeAdwS AwrHubSourceTypeEnum = "ADW_S" + AwrHubSourceTypeAtpS AwrHubSourceTypeEnum = "ATP_S" + AwrHubSourceTypeAdwD AwrHubSourceTypeEnum = "ADW_D" + AwrHubSourceTypeAtpD AwrHubSourceTypeEnum = "ATP_D" + AwrHubSourceTypeExternalPdb AwrHubSourceTypeEnum = "EXTERNAL_PDB" + AwrHubSourceTypeExternalNoncdb AwrHubSourceTypeEnum = "EXTERNAL_NONCDB" + AwrHubSourceTypeComanagedVmCdb AwrHubSourceTypeEnum = "COMANAGED_VM_CDB" + AwrHubSourceTypeComanagedVmPdb AwrHubSourceTypeEnum = "COMANAGED_VM_PDB" + AwrHubSourceTypeComanagedVmNoncdb AwrHubSourceTypeEnum = "COMANAGED_VM_NONCDB" + AwrHubSourceTypeComanagedBmCdb AwrHubSourceTypeEnum = "COMANAGED_BM_CDB" + AwrHubSourceTypeComanagedBmPdb AwrHubSourceTypeEnum = "COMANAGED_BM_PDB" + AwrHubSourceTypeComanagedBmNoncdb AwrHubSourceTypeEnum = "COMANAGED_BM_NONCDB" + AwrHubSourceTypeComanagedExacsCdb AwrHubSourceTypeEnum = "COMANAGED_EXACS_CDB" + AwrHubSourceTypeComanagedExacsPdb AwrHubSourceTypeEnum = "COMANAGED_EXACS_PDB" + AwrHubSourceTypeComanagedExacsNoncdb AwrHubSourceTypeEnum = "COMANAGED_EXACS_NONCDB" + AwrHubSourceTypeUndefined AwrHubSourceTypeEnum = "UNDEFINED" +) + +var mappingAwrHubSourceTypeEnum = map[string]AwrHubSourceTypeEnum{ + "ADW_S": AwrHubSourceTypeAdwS, + "ATP_S": AwrHubSourceTypeAtpS, + "ADW_D": AwrHubSourceTypeAdwD, + "ATP_D": AwrHubSourceTypeAtpD, + "EXTERNAL_PDB": AwrHubSourceTypeExternalPdb, + "EXTERNAL_NONCDB": AwrHubSourceTypeExternalNoncdb, + "COMANAGED_VM_CDB": AwrHubSourceTypeComanagedVmCdb, + "COMANAGED_VM_PDB": AwrHubSourceTypeComanagedVmPdb, + "COMANAGED_VM_NONCDB": AwrHubSourceTypeComanagedVmNoncdb, + "COMANAGED_BM_CDB": AwrHubSourceTypeComanagedBmCdb, + "COMANAGED_BM_PDB": AwrHubSourceTypeComanagedBmPdb, + "COMANAGED_BM_NONCDB": AwrHubSourceTypeComanagedBmNoncdb, + "COMANAGED_EXACS_CDB": AwrHubSourceTypeComanagedExacsCdb, + "COMANAGED_EXACS_PDB": AwrHubSourceTypeComanagedExacsPdb, + "COMANAGED_EXACS_NONCDB": AwrHubSourceTypeComanagedExacsNoncdb, + "UNDEFINED": AwrHubSourceTypeUndefined, +} + +var mappingAwrHubSourceTypeEnumLowerCase = map[string]AwrHubSourceTypeEnum{ + "adw_s": AwrHubSourceTypeAdwS, + "atp_s": AwrHubSourceTypeAtpS, + "adw_d": AwrHubSourceTypeAdwD, + "atp_d": AwrHubSourceTypeAtpD, + "external_pdb": AwrHubSourceTypeExternalPdb, + "external_noncdb": AwrHubSourceTypeExternalNoncdb, + "comanaged_vm_cdb": AwrHubSourceTypeComanagedVmCdb, + "comanaged_vm_pdb": AwrHubSourceTypeComanagedVmPdb, + "comanaged_vm_noncdb": AwrHubSourceTypeComanagedVmNoncdb, + "comanaged_bm_cdb": AwrHubSourceTypeComanagedBmCdb, + "comanaged_bm_pdb": AwrHubSourceTypeComanagedBmPdb, + "comanaged_bm_noncdb": AwrHubSourceTypeComanagedBmNoncdb, + "comanaged_exacs_cdb": AwrHubSourceTypeComanagedExacsCdb, + "comanaged_exacs_pdb": AwrHubSourceTypeComanagedExacsPdb, + "comanaged_exacs_noncdb": AwrHubSourceTypeComanagedExacsNoncdb, + "undefined": AwrHubSourceTypeUndefined, +} + +// GetAwrHubSourceTypeEnumValues Enumerates the set of values for AwrHubSourceTypeEnum +func GetAwrHubSourceTypeEnumValues() []AwrHubSourceTypeEnum { + values := make([]AwrHubSourceTypeEnum, 0) + for _, v := range mappingAwrHubSourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetAwrHubSourceTypeEnumStringValues Enumerates the set of values in String for AwrHubSourceTypeEnum +func GetAwrHubSourceTypeEnumStringValues() []string { + return []string{ + "ADW_S", + "ATP_S", + "ADW_D", + "ATP_D", + "EXTERNAL_PDB", + "EXTERNAL_NONCDB", + "COMANAGED_VM_CDB", + "COMANAGED_VM_PDB", + "COMANAGED_VM_NONCDB", + "COMANAGED_BM_CDB", + "COMANAGED_BM_PDB", + "COMANAGED_BM_NONCDB", + "COMANAGED_EXACS_CDB", + "COMANAGED_EXACS_PDB", + "COMANAGED_EXACS_NONCDB", + "UNDEFINED", + } +} + +// GetMappingAwrHubSourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAwrHubSourceTypeEnum(val string) (AwrHubSourceTypeEnum, bool) { + enum, ok := mappingAwrHubSourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/awr_hub_sources.go b/opsi/awr_hub_sources.go new file mode 100644 index 0000000000..242b1c10a8 --- /dev/null +++ b/opsi/awr_hub_sources.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AwrHubSources Logical grouping used for Awr Hub Source operations. +type AwrHubSources struct { + + // Awr Hub Source Object. + AwrHubSources *interface{} `mandatory:"false" json:"awrHubSources"` +} + +func (m AwrHubSources) String() string { + return common.PointerString(m) +} + +// 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 (m AwrHubSources) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/change_awr_hub_source_compartment_details.go b/opsi/change_awr_hub_source_compartment_details.go new file mode 100644 index 0000000000..33ea920d2e --- /dev/null +++ b/opsi/change_awr_hub_source_compartment_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeAwrHubSourceCompartmentDetails The information to be updated. +type ChangeAwrHubSourceCompartmentDetails struct { + + // The OCID of the compartment into which the resource should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeAwrHubSourceCompartmentDetails) String() string { + return common.PointerString(m) +} + +// 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 (m ChangeAwrHubSourceCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/change_awr_hub_source_compartment_request_response.go b/opsi/change_awr_hub_source_compartment_request_response.go new file mode 100644 index 0000000000..0b69ee860c --- /dev/null +++ b/opsi/change_awr_hub_source_compartment_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeAwrHubSourceCompartmentRequest wrapper for the ChangeAwrHubSourceCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ChangeAwrHubSourceCompartment.go.html to see an example of how to use ChangeAwrHubSourceCompartmentRequest. +type ChangeAwrHubSourceCompartmentRequest struct { + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // The information to be updated. + ChangeAwrHubSourceCompartmentDetails `contributesTo:"body"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request that can be retried in case of a timeout or + // server error without risk of executing the same action again. Retry tokens expire after 24 + // hours. + // *Note:* Retry tokens can be invalidated before the 24 hour time limit due to conflicting + // operations, such as a resource being deleted or purged from the system. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 ChangeAwrHubSourceCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeAwrHubSourceCompartmentRequest) 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 ChangeAwrHubSourceCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeAwrHubSourceCompartmentRequest) 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 ChangeAwrHubSourceCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeAwrHubSourceCompartmentResponse wrapper for the ChangeAwrHubSourceCompartment operation +type ChangeAwrHubSourceCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + 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 ChangeAwrHubSourceCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeAwrHubSourceCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/opsi/change_operations_insights_warehouse_compartment_details.go b/opsi/change_operations_insights_warehouse_compartment_details.go new file mode 100644 index 0000000000..3adc77608f --- /dev/null +++ b/opsi/change_operations_insights_warehouse_compartment_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeOperationsInsightsWarehouseCompartmentDetails The information to be updated. +type ChangeOperationsInsightsWarehouseCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeOperationsInsightsWarehouseCompartmentDetails) String() string { + return common.PointerString(m) +} + +// 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 (m ChangeOperationsInsightsWarehouseCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/change_operations_insights_warehouse_compartment_request_response.go b/opsi/change_operations_insights_warehouse_compartment_request_response.go new file mode 100644 index 0000000000..30ce823b58 --- /dev/null +++ b/opsi/change_operations_insights_warehouse_compartment_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeOperationsInsightsWarehouseCompartmentRequest wrapper for the ChangeOperationsInsightsWarehouseCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ChangeOperationsInsightsWarehouseCompartment.go.html to see an example of how to use ChangeOperationsInsightsWarehouseCompartmentRequest. +type ChangeOperationsInsightsWarehouseCompartmentRequest struct { + + // Unique Operations Insights Warehouse identifier + OperationsInsightsWarehouseId *string `mandatory:"true" contributesTo:"path" name:"operationsInsightsWarehouseId"` + + // The information to be updated. + ChangeOperationsInsightsWarehouseCompartmentDetails `contributesTo:"body"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request that can be retried in case of a timeout or + // server error without risk of executing the same action again. Retry tokens expire after 24 + // hours. + // *Note:* Retry tokens can be invalidated before the 24 hour time limit due to conflicting + // operations, such as a resource being deleted or purged from the system. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 ChangeOperationsInsightsWarehouseCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeOperationsInsightsWarehouseCompartmentRequest) 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 ChangeOperationsInsightsWarehouseCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeOperationsInsightsWarehouseCompartmentRequest) 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 ChangeOperationsInsightsWarehouseCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeOperationsInsightsWarehouseCompartmentResponse wrapper for the ChangeOperationsInsightsWarehouseCompartment operation +type ChangeOperationsInsightsWarehouseCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + 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 ChangeOperationsInsightsWarehouseCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeOperationsInsightsWarehouseCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/opsi/create_awr_hub_details.go b/opsi/create_awr_hub_details.go index ed0ea7c5e6..aee100aca5 100644 --- a/opsi/create_awr_hub_details.go +++ b/opsi/create_awr_hub_details.go @@ -30,7 +30,7 @@ type CreateAwrHubDetails struct { DisplayName *string `mandatory:"true" json:"displayName"` // Object Storage Bucket Name - ObjectStorageBucketName *string `mandatory:"true" json:"objectStorageBucketName"` + ObjectStorageBucketName *string `mandatory:"false" json:"objectStorageBucketName"` // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}` diff --git a/opsi/create_awr_hub_source_details.go b/opsi/create_awr_hub_source_details.go new file mode 100644 index 0000000000..e04839828e --- /dev/null +++ b/opsi/create_awr_hub_source_details.go @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateAwrHubSourceDetails payload to register Awr Hub source +type CreateAwrHubSourceDetails struct { + + // The name of the Awr Hub source database. + Name *string `mandatory:"true" json:"name"` + + // AWR Hub OCID + AwrHubId *string `mandatory:"true" json:"awrHubId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // source type of the database + Type AwrHubSourceTypeEnum `mandatory:"true" json:"type"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database id. + AssociatedResourceId *string `mandatory:"false" json:"associatedResourceId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database id. + AssociatedOpsiId *string `mandatory:"false" json:"associatedOpsiId"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateAwrHubSourceDetails) String() string { + return common.PointerString(m) +} + +// 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 (m CreateAwrHubSourceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAwrHubSourceTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetAwrHubSourceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/create_awr_hub_source_request_response.go b/opsi/create_awr_hub_source_request_response.go new file mode 100644 index 0000000000..7ea080aeb1 --- /dev/null +++ b/opsi/create_awr_hub_source_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateAwrHubSourceRequest wrapper for the CreateAwrHubSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/CreateAwrHubSource.go.html to see an example of how to use CreateAwrHubSourceRequest. +type CreateAwrHubSourceRequest struct { + + // Payload containing details to register the source database + CreateAwrHubSourceDetails `contributesTo:"body"` + + // A token that uniquely identifies a request that can be retried in case of a timeout or + // server error without risk of executing the same action again. Retry tokens expire after 24 + // hours. + // *Note:* Retry tokens can be invalidated before the 24 hour time limit due to conflicting + // operations, such as a resource being deleted or purged from the system. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 CreateAwrHubSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateAwrHubSourceRequest) 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 CreateAwrHubSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateAwrHubSourceRequest) 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 CreateAwrHubSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateAwrHubSourceResponse wrapper for the CreateAwrHubSource operation +type CreateAwrHubSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AwrHubSource instance + AwrHubSource `presentIn:"body"` + + // 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"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateAwrHubSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateAwrHubSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/opsi/delete_awr_hub_object_request_response.go b/opsi/delete_awr_hub_object_request_response.go new file mode 100644 index 0000000000..abbf6d7fc6 --- /dev/null +++ b/opsi/delete_awr_hub_object_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteAwrHubObjectRequest wrapper for the DeleteAwrHubObject operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/DeleteAwrHubObject.go.html to see an example of how to use DeleteAwrHubObjectRequest. +type DeleteAwrHubObjectRequest struct { + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // Unique Awr Hub Object identifier + ObjectName *string `mandatory:"true" contributesTo:"path" name:"objectName"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteAwrHubObjectRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAwrHubObjectRequest) 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 DeleteAwrHubObjectRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAwrHubObjectRequest) 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 DeleteAwrHubObjectRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteAwrHubObjectResponse wrapper for the DeleteAwrHubObject operation +type DeleteAwrHubObjectResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-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"` + + // The Awr Hub object modification time. + LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` + + // VersionId of the requested Awr Hub object. + VersionId *string `presentIn:"header" name:"version-id"` + + // This is `true` if the deleted object is a delete marker, otherwise `false` + IsDeleteMarker *bool `presentIn:"header" name:"is-delete-marker"` +} + +func (response DeleteAwrHubObjectResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAwrHubObjectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/opsi/delete_awr_hub_source_request_response.go b/opsi/delete_awr_hub_source_request_response.go new file mode 100644 index 0000000000..37c1787fa1 --- /dev/null +++ b/opsi/delete_awr_hub_source_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteAwrHubSourceRequest wrapper for the DeleteAwrHubSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/DeleteAwrHubSource.go.html to see an example of how to use DeleteAwrHubSourceRequest. +type DeleteAwrHubSourceRequest struct { + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteAwrHubSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteAwrHubSourceRequest) 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 DeleteAwrHubSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteAwrHubSourceRequest) 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 DeleteAwrHubSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteAwrHubSourceResponse wrapper for the DeleteAwrHubSource operation +type DeleteAwrHubSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + 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 DeleteAwrHubSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteAwrHubSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/opsi/disable_awr_hub_source_request_response.go b/opsi/disable_awr_hub_source_request_response.go new file mode 100644 index 0000000000..cda50c2a44 --- /dev/null +++ b/opsi/disable_awr_hub_source_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DisableAwrHubSourceRequest wrapper for the DisableAwrHubSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/DisableAwrHubSource.go.html to see an example of how to use DisableAwrHubSourceRequest. +type DisableAwrHubSourceRequest struct { + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request that can be retried in case of a timeout or + // server error without risk of executing the same action again. Retry tokens expire after 24 + // hours. + // *Note:* Retry tokens can be invalidated before the 24 hour time limit due to conflicting + // operations, such as a resource being deleted or purged from the system. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 DisableAwrHubSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DisableAwrHubSourceRequest) 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 DisableAwrHubSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DisableAwrHubSourceRequest) 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 DisableAwrHubSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DisableAwrHubSourceResponse wrapper for the DisableAwrHubSource operation +type DisableAwrHubSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + 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 DisableAwrHubSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DisableAwrHubSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/opsi/enable_awr_hub_source_request_response.go b/opsi/enable_awr_hub_source_request_response.go new file mode 100644 index 0000000000..e638206259 --- /dev/null +++ b/opsi/enable_awr_hub_source_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// EnableAwrHubSourceRequest wrapper for the EnableAwrHubSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/EnableAwrHubSource.go.html to see an example of how to use EnableAwrHubSourceRequest. +type EnableAwrHubSourceRequest struct { + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request that can be retried in case of a timeout or + // server error without risk of executing the same action again. Retry tokens expire after 24 + // hours. + // *Note:* Retry tokens can be invalidated before the 24 hour time limit due to conflicting + // operations, such as a resource being deleted or purged from the system. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 EnableAwrHubSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EnableAwrHubSourceRequest) 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 EnableAwrHubSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EnableAwrHubSourceRequest) 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 EnableAwrHubSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EnableAwrHubSourceResponse wrapper for the EnableAwrHubSource operation +type EnableAwrHubSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + 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 EnableAwrHubSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EnableAwrHubSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/opsi/get_awr_hub_object_request_response.go b/opsi/get_awr_hub_object_request_response.go new file mode 100644 index 0000000000..fe47a072c1 --- /dev/null +++ b/opsi/get_awr_hub_object_request_response.go @@ -0,0 +1,246 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// GetAwrHubObjectRequest wrapper for the GetAwrHubObject operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/GetAwrHubObject.go.html to see an example of how to use GetAwrHubObjectRequest. +type GetAwrHubObjectRequest struct { + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // Unique Awr Hub Object identifier + ObjectName *string `mandatory:"true" contributesTo:"path" name:"objectName"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetAwrHubObjectRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAwrHubObjectRequest) 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 GetAwrHubObjectRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAwrHubObjectRequest) 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 GetAwrHubObjectRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetAwrHubObjectResponse wrapper for the GetAwrHubObject operation +type GetAwrHubObjectResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-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"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The user-defined metadata for the Awr Hub object. + OpcMeta map[string]string `presentIn:"header-collection" prefix:"opc-meta-"` + + // The Awr Hub object size in bytes. + ContentLength *int64 `presentIn:"header" name:"content-length"` + + // Content-Range header. + ContentRange *string `presentIn:"header" name:"content-range"` + + // Content-MD5 header. + ContentMd5 *string `presentIn:"header" name:"content-md5"` + + OpcMultipartMd5 *string `presentIn:"header" name:"opc-multipart-md5"` + + // Content-Type header. + ContentType *string `presentIn:"header" name:"content-type"` + + // Content-Language header. + ContentLanguage *string `presentIn:"header" name:"content-language"` + + // Content-Encoding header. + ContentEncoding *string `presentIn:"header" name:"content-encoding"` + + // Cache-Control header. + CacheControl *string `presentIn:"header" name:"cache-control"` + + // Content-Disposition header. + ContentDisposition *string `presentIn:"header" name:"content-disposition"` + + // The Awr Hub object modification time. + LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` + + // The storage tier that the Awr Hub object is stored in. + StorageTier GetAwrHubObjectStorageTierEnum `presentIn:"header" name:"storage-tier"` + + // Archival state of an Awr Hub object. This field is set only for Awr Hub objects in Archive tier. + ArchivalState GetAwrHubObjectArchivalStateEnum `presentIn:"header" name:"archival-state"` + + // Time that the Awr Hub object is returned to the archived state. + TimeOfArchival *common.SDKTime `presentIn:"header" name:"time-of-archival"` + + // VersionId of the requested Awr Hub object. + VersionId *string `presentIn:"header" name:"version-id"` + + // The date and time after which the Awr Hub object is no longer cached by a browser, proxy, or other caching entity. + Expires *common.SDKTime `presentIn:"header" name:"expires"` + + // Flag to indicate whether or not the object was modified. If this is true, + // the getter for the object itself will return null. Callers should check this + // if they specified one of the request params that might result in a conditional + // response (like 'if-match'/'if-none-match'). + IsNotModified bool +} + +func (response GetAwrHubObjectResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAwrHubObjectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetAwrHubObjectStorageTierEnum Enum with underlying type: string +type GetAwrHubObjectStorageTierEnum string + +// Set of constants representing the allowable values for GetAwrHubObjectStorageTierEnum +const ( + GetAwrHubObjectStorageTierStandard GetAwrHubObjectStorageTierEnum = "STANDARD" + GetAwrHubObjectStorageTierInfrequentaccess GetAwrHubObjectStorageTierEnum = "INFREQUENTACCESS" + GetAwrHubObjectStorageTierArchive GetAwrHubObjectStorageTierEnum = "ARCHIVE" +) + +var mappingGetAwrHubObjectStorageTierEnum = map[string]GetAwrHubObjectStorageTierEnum{ + "STANDARD": GetAwrHubObjectStorageTierStandard, + "INFREQUENTACCESS": GetAwrHubObjectStorageTierInfrequentaccess, + "ARCHIVE": GetAwrHubObjectStorageTierArchive, +} + +var mappingGetAwrHubObjectStorageTierEnumLowerCase = map[string]GetAwrHubObjectStorageTierEnum{ + "standard": GetAwrHubObjectStorageTierStandard, + "infrequentaccess": GetAwrHubObjectStorageTierInfrequentaccess, + "archive": GetAwrHubObjectStorageTierArchive, +} + +// GetGetAwrHubObjectStorageTierEnumValues Enumerates the set of values for GetAwrHubObjectStorageTierEnum +func GetGetAwrHubObjectStorageTierEnumValues() []GetAwrHubObjectStorageTierEnum { + values := make([]GetAwrHubObjectStorageTierEnum, 0) + for _, v := range mappingGetAwrHubObjectStorageTierEnum { + values = append(values, v) + } + return values +} + +// GetGetAwrHubObjectStorageTierEnumStringValues Enumerates the set of values in String for GetAwrHubObjectStorageTierEnum +func GetGetAwrHubObjectStorageTierEnumStringValues() []string { + return []string{ + "STANDARD", + "INFREQUENTACCESS", + "ARCHIVE", + } +} + +// GetMappingGetAwrHubObjectStorageTierEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetAwrHubObjectStorageTierEnum(val string) (GetAwrHubObjectStorageTierEnum, bool) { + enum, ok := mappingGetAwrHubObjectStorageTierEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// GetAwrHubObjectArchivalStateEnum Enum with underlying type: string +type GetAwrHubObjectArchivalStateEnum string + +// Set of constants representing the allowable values for GetAwrHubObjectArchivalStateEnum +const ( + GetAwrHubObjectArchivalStateArchived GetAwrHubObjectArchivalStateEnum = "ARCHIVED" + GetAwrHubObjectArchivalStateRestoring GetAwrHubObjectArchivalStateEnum = "RESTORING" + GetAwrHubObjectArchivalStateRestored GetAwrHubObjectArchivalStateEnum = "RESTORED" +) + +var mappingGetAwrHubObjectArchivalStateEnum = map[string]GetAwrHubObjectArchivalStateEnum{ + "ARCHIVED": GetAwrHubObjectArchivalStateArchived, + "RESTORING": GetAwrHubObjectArchivalStateRestoring, + "RESTORED": GetAwrHubObjectArchivalStateRestored, +} + +var mappingGetAwrHubObjectArchivalStateEnumLowerCase = map[string]GetAwrHubObjectArchivalStateEnum{ + "archived": GetAwrHubObjectArchivalStateArchived, + "restoring": GetAwrHubObjectArchivalStateRestoring, + "restored": GetAwrHubObjectArchivalStateRestored, +} + +// GetGetAwrHubObjectArchivalStateEnumValues Enumerates the set of values for GetAwrHubObjectArchivalStateEnum +func GetGetAwrHubObjectArchivalStateEnumValues() []GetAwrHubObjectArchivalStateEnum { + values := make([]GetAwrHubObjectArchivalStateEnum, 0) + for _, v := range mappingGetAwrHubObjectArchivalStateEnum { + values = append(values, v) + } + return values +} + +// GetGetAwrHubObjectArchivalStateEnumStringValues Enumerates the set of values in String for GetAwrHubObjectArchivalStateEnum +func GetGetAwrHubObjectArchivalStateEnumStringValues() []string { + return []string{ + "ARCHIVED", + "RESTORING", + "RESTORED", + } +} + +// GetMappingGetAwrHubObjectArchivalStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetAwrHubObjectArchivalStateEnum(val string) (GetAwrHubObjectArchivalStateEnum, bool) { + enum, ok := mappingGetAwrHubObjectArchivalStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/get_awr_hub_source_request_response.go b/opsi/get_awr_hub_source_request_response.go new file mode 100644 index 0000000000..edebfe540d --- /dev/null +++ b/opsi/get_awr_hub_source_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetAwrHubSourceRequest wrapper for the GetAwrHubSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/GetAwrHubSource.go.html to see an example of how to use GetAwrHubSourceRequest. +type GetAwrHubSourceRequest struct { + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 GetAwrHubSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAwrHubSourceRequest) 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 GetAwrHubSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAwrHubSourceRequest) 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 GetAwrHubSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetAwrHubSourceResponse wrapper for the GetAwrHubSource operation +type GetAwrHubSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AwrHubSource instance + AwrHubSource `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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 GetAwrHubSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAwrHubSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/opsi/head_awr_hub_object_request_response.go b/opsi/head_awr_hub_object_request_response.go new file mode 100644 index 0000000000..daf23ecf7a --- /dev/null +++ b/opsi/head_awr_hub_object_request_response.go @@ -0,0 +1,236 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// HeadAwrHubObjectRequest wrapper for the HeadAwrHubObject operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/HeadAwrHubObject.go.html to see an example of how to use HeadAwrHubObjectRequest. +type HeadAwrHubObjectRequest struct { + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // Unique Awr Hub Object identifier + ObjectName *string `mandatory:"true" contributesTo:"path" name:"objectName"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 HeadAwrHubObjectRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request HeadAwrHubObjectRequest) 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 HeadAwrHubObjectRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request HeadAwrHubObjectRequest) 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 HeadAwrHubObjectRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// HeadAwrHubObjectResponse wrapper for the HeadAwrHubObject operation +type HeadAwrHubObjectResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-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"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The user-defined metadata for the Awr Hub object. + OpcMeta map[string]string `presentIn:"header-collection" prefix:"opc-meta-"` + + // The Awr Hub object size in bytes. + ContentLength *int64 `presentIn:"header" name:"content-length"` + + // Content-MD5 header. + ContentMd5 *string `presentIn:"header" name:"content-md5"` + + OpcMultipartMd5 *string `presentIn:"header" name:"opc-multipart-md5"` + + // Content-Type header. + ContentType *string `presentIn:"header" name:"content-type"` + + // Content-Language header. + ContentLanguage *string `presentIn:"header" name:"content-language"` + + // Content-Encoding header. + ContentEncoding *string `presentIn:"header" name:"content-encoding"` + + // Cache-Control header. + CacheControl *string `presentIn:"header" name:"cache-control"` + + // Content-Disposition header. + ContentDisposition *string `presentIn:"header" name:"content-disposition"` + + // The Awr Hub object modification time. + LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` + + // The storage tier that the Awr Hub object is stored in. + StorageTier HeadAwrHubObjectStorageTierEnum `presentIn:"header" name:"storage-tier"` + + // Archival state of an Awr Hub object. This field is set only for Awr Hub objects in Archive tier. + ArchivalState HeadAwrHubObjectArchivalStateEnum `presentIn:"header" name:"archival-state"` + + // Time that the Awr Hub object is returned to the archived state. + TimeOfArchival *common.SDKTime `presentIn:"header" name:"time-of-archival"` + + // VersionId of the requested Awr Hub object. + VersionId *string `presentIn:"header" name:"version-id"` + + // Flag to indicate whether or not the object was modified. If this is true, + // the getter for the object itself will return null. Callers should check this + // if they specified one of the request params that might result in a conditional + // response (like 'if-match'/'if-none-match'). + IsNotModified bool +} + +func (response HeadAwrHubObjectResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response HeadAwrHubObjectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// HeadAwrHubObjectStorageTierEnum Enum with underlying type: string +type HeadAwrHubObjectStorageTierEnum string + +// Set of constants representing the allowable values for HeadAwrHubObjectStorageTierEnum +const ( + HeadAwrHubObjectStorageTierStandard HeadAwrHubObjectStorageTierEnum = "STANDARD" + HeadAwrHubObjectStorageTierInfrequentaccess HeadAwrHubObjectStorageTierEnum = "INFREQUENTACCESS" + HeadAwrHubObjectStorageTierArchive HeadAwrHubObjectStorageTierEnum = "ARCHIVE" +) + +var mappingHeadAwrHubObjectStorageTierEnum = map[string]HeadAwrHubObjectStorageTierEnum{ + "STANDARD": HeadAwrHubObjectStorageTierStandard, + "INFREQUENTACCESS": HeadAwrHubObjectStorageTierInfrequentaccess, + "ARCHIVE": HeadAwrHubObjectStorageTierArchive, +} + +var mappingHeadAwrHubObjectStorageTierEnumLowerCase = map[string]HeadAwrHubObjectStorageTierEnum{ + "standard": HeadAwrHubObjectStorageTierStandard, + "infrequentaccess": HeadAwrHubObjectStorageTierInfrequentaccess, + "archive": HeadAwrHubObjectStorageTierArchive, +} + +// GetHeadAwrHubObjectStorageTierEnumValues Enumerates the set of values for HeadAwrHubObjectStorageTierEnum +func GetHeadAwrHubObjectStorageTierEnumValues() []HeadAwrHubObjectStorageTierEnum { + values := make([]HeadAwrHubObjectStorageTierEnum, 0) + for _, v := range mappingHeadAwrHubObjectStorageTierEnum { + values = append(values, v) + } + return values +} + +// GetHeadAwrHubObjectStorageTierEnumStringValues Enumerates the set of values in String for HeadAwrHubObjectStorageTierEnum +func GetHeadAwrHubObjectStorageTierEnumStringValues() []string { + return []string{ + "STANDARD", + "INFREQUENTACCESS", + "ARCHIVE", + } +} + +// GetMappingHeadAwrHubObjectStorageTierEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingHeadAwrHubObjectStorageTierEnum(val string) (HeadAwrHubObjectStorageTierEnum, bool) { + enum, ok := mappingHeadAwrHubObjectStorageTierEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// HeadAwrHubObjectArchivalStateEnum Enum with underlying type: string +type HeadAwrHubObjectArchivalStateEnum string + +// Set of constants representing the allowable values for HeadAwrHubObjectArchivalStateEnum +const ( + HeadAwrHubObjectArchivalStateArchived HeadAwrHubObjectArchivalStateEnum = "ARCHIVED" + HeadAwrHubObjectArchivalStateRestoring HeadAwrHubObjectArchivalStateEnum = "RESTORING" + HeadAwrHubObjectArchivalStateRestored HeadAwrHubObjectArchivalStateEnum = "RESTORED" +) + +var mappingHeadAwrHubObjectArchivalStateEnum = map[string]HeadAwrHubObjectArchivalStateEnum{ + "ARCHIVED": HeadAwrHubObjectArchivalStateArchived, + "RESTORING": HeadAwrHubObjectArchivalStateRestoring, + "RESTORED": HeadAwrHubObjectArchivalStateRestored, +} + +var mappingHeadAwrHubObjectArchivalStateEnumLowerCase = map[string]HeadAwrHubObjectArchivalStateEnum{ + "archived": HeadAwrHubObjectArchivalStateArchived, + "restoring": HeadAwrHubObjectArchivalStateRestoring, + "restored": HeadAwrHubObjectArchivalStateRestored, +} + +// GetHeadAwrHubObjectArchivalStateEnumValues Enumerates the set of values for HeadAwrHubObjectArchivalStateEnum +func GetHeadAwrHubObjectArchivalStateEnumValues() []HeadAwrHubObjectArchivalStateEnum { + values := make([]HeadAwrHubObjectArchivalStateEnum, 0) + for _, v := range mappingHeadAwrHubObjectArchivalStateEnum { + values = append(values, v) + } + return values +} + +// GetHeadAwrHubObjectArchivalStateEnumStringValues Enumerates the set of values in String for HeadAwrHubObjectArchivalStateEnum +func GetHeadAwrHubObjectArchivalStateEnumStringValues() []string { + return []string{ + "ARCHIVED", + "RESTORING", + "RESTORED", + } +} + +// GetMappingHeadAwrHubObjectArchivalStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingHeadAwrHubObjectArchivalStateEnum(val string) (HeadAwrHubObjectArchivalStateEnum, bool) { + enum, ok := mappingHeadAwrHubObjectArchivalStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/list_awr_hub_objects_request_response.go b/opsi/list_awr_hub_objects_request_response.go new file mode 100644 index 0000000000..6d3405de52 --- /dev/null +++ b/opsi/list_awr_hub_objects_request_response.go @@ -0,0 +1,205 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListAwrHubObjectsRequest wrapper for the ListAwrHubObjects operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ListAwrHubObjects.go.html to see an example of how to use ListAwrHubObjectsRequest. +type ListAwrHubObjectsRequest struct { + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // The string to use for matching against the start of object names in a Awr Hub list objects query. + Prefix *string `mandatory:"false" contributesTo:"query" name:"prefix"` + + // Object names returned by Awr Hub list objects query must be greater or equal to this parameter. + Start *string `mandatory:"false" contributesTo:"query" name:"start"` + + // Object names returned by Awr Hub list objects query must be strictly less than this parameter. + End *string `mandatory:"false" contributesTo:"query" name:"end"` + + // When this parameter is set, only objects whose names do not contain the delimiter character + // (after an optionally specified prefix) are returned in the Awr Hub list objects key of the response body. + // Scanned objects whose names contain the delimiter have the part of their name up to the first + // occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. + // Note that only '/' is a supported delimiter character at this time. + Delimiter *string `mandatory:"false" contributesTo:"query" name:"delimiter"` + + // Awr Hub Object name after which remaining objects are listed + StartAfter *string `mandatory:"false" contributesTo:"query" name:"startAfter"` + + // For list pagination. The value of the `opc-next-page` response header from + // the previous "List" call. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to + // return in a paginated "List" call. + // For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // By default all the fields are returned. Use this parameter to fetch specific fields 'size', 'etag', 'md5', + // 'timeCreated', 'timeModified', 'storageTier' and 'archivalState' fields. List the names of those fields + // in a comma-separated, case-insensitive list as the value of this parameter. + // For example: 'name,etag,timeCreated,md5,timeModified,storageTier,archivalState'. + Fields ListAwrHubObjectsFieldsEnum `mandatory:"false" contributesTo:"query" name:"fields" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 ListAwrHubObjectsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAwrHubObjectsRequest) 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 ListAwrHubObjectsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAwrHubObjectsRequest) 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 ListAwrHubObjectsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListAwrHubObjectsFieldsEnum(string(request.Fields)); !ok && request.Fields != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Fields: %s. Supported values are: %s.", request.Fields, strings.Join(GetListAwrHubObjectsFieldsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListAwrHubObjectsResponse wrapper for the ListAwrHubObjects operation +type ListAwrHubObjectsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ListObjects instances + ListObjects `presentIn:"body"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-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"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListAwrHubObjectsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAwrHubObjectsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAwrHubObjectsFieldsEnum Enum with underlying type: string +type ListAwrHubObjectsFieldsEnum string + +// Set of constants representing the allowable values for ListAwrHubObjectsFieldsEnum +const ( + ListAwrHubObjectsFieldsName ListAwrHubObjectsFieldsEnum = "name" + ListAwrHubObjectsFieldsSize ListAwrHubObjectsFieldsEnum = "size" + ListAwrHubObjectsFieldsEtag ListAwrHubObjectsFieldsEnum = "etag" + ListAwrHubObjectsFieldsTimecreated ListAwrHubObjectsFieldsEnum = "timeCreated" + ListAwrHubObjectsFieldsMd5 ListAwrHubObjectsFieldsEnum = "md5" + ListAwrHubObjectsFieldsArchivalstate ListAwrHubObjectsFieldsEnum = "archivalState" + ListAwrHubObjectsFieldsTimemodified ListAwrHubObjectsFieldsEnum = "timeModified" + ListAwrHubObjectsFieldsStoragetier ListAwrHubObjectsFieldsEnum = "storageTier" +) + +var mappingListAwrHubObjectsFieldsEnum = map[string]ListAwrHubObjectsFieldsEnum{ + "name": ListAwrHubObjectsFieldsName, + "size": ListAwrHubObjectsFieldsSize, + "etag": ListAwrHubObjectsFieldsEtag, + "timeCreated": ListAwrHubObjectsFieldsTimecreated, + "md5": ListAwrHubObjectsFieldsMd5, + "archivalState": ListAwrHubObjectsFieldsArchivalstate, + "timeModified": ListAwrHubObjectsFieldsTimemodified, + "storageTier": ListAwrHubObjectsFieldsStoragetier, +} + +var mappingListAwrHubObjectsFieldsEnumLowerCase = map[string]ListAwrHubObjectsFieldsEnum{ + "name": ListAwrHubObjectsFieldsName, + "size": ListAwrHubObjectsFieldsSize, + "etag": ListAwrHubObjectsFieldsEtag, + "timecreated": ListAwrHubObjectsFieldsTimecreated, + "md5": ListAwrHubObjectsFieldsMd5, + "archivalstate": ListAwrHubObjectsFieldsArchivalstate, + "timemodified": ListAwrHubObjectsFieldsTimemodified, + "storagetier": ListAwrHubObjectsFieldsStoragetier, +} + +// GetListAwrHubObjectsFieldsEnumValues Enumerates the set of values for ListAwrHubObjectsFieldsEnum +func GetListAwrHubObjectsFieldsEnumValues() []ListAwrHubObjectsFieldsEnum { + values := make([]ListAwrHubObjectsFieldsEnum, 0) + for _, v := range mappingListAwrHubObjectsFieldsEnum { + values = append(values, v) + } + return values +} + +// GetListAwrHubObjectsFieldsEnumStringValues Enumerates the set of values in String for ListAwrHubObjectsFieldsEnum +func GetListAwrHubObjectsFieldsEnumStringValues() []string { + return []string{ + "name", + "size", + "etag", + "timeCreated", + "md5", + "archivalState", + "timeModified", + "storageTier", + } +} + +// GetMappingListAwrHubObjectsFieldsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListAwrHubObjectsFieldsEnum(val string) (ListAwrHubObjectsFieldsEnum, bool) { + enum, ok := mappingListAwrHubObjectsFieldsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/list_awr_hub_sources_request_response.go b/opsi/list_awr_hub_sources_request_response.go new file mode 100644 index 0000000000..14ec901553 --- /dev/null +++ b/opsi/list_awr_hub_sources_request_response.go @@ -0,0 +1,241 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListAwrHubSourcesRequest wrapper for the ListAwrHubSources operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ListAwrHubSources.go.html to see an example of how to use ListAwrHubSourcesRequest. +type ListAwrHubSourcesRequest struct { + + // Unique Awr Hub identifier + AwrHubId *string `mandatory:"true" contributesTo:"query" name:"awrHubId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Awr Hub source identifier + AwrHubSourceId *string `mandatory:"false" contributesTo:"query" name:"awrHubSourceId"` + + // Filter by one or more database type. + // Possible values are ADW-S, ATP-S, ADW-D, ATP-D, EXTERNAL-PDB, EXTERNAL-NONCDB. + SourceType []AwrHubSourceTypeEnum `contributesTo:"query" name:"sourceType" omitEmpty:"true" collectionFormat:"multi"` + + // Awr Hub source database name + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // Resource Status + Status []AwrHubSourceStatusEnum `contributesTo:"query" name:"status" omitEmpty:"true" collectionFormat:"multi"` + + // Lifecycle states + LifecycleState []AwrHubSourceLifecycleStateEnum `contributesTo:"query" name:"lifecycleState" omitEmpty:"true" collectionFormat:"multi"` + + // For list pagination. The maximum number of results per page, or items to + // return in a paginated "List" call. + // For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from + // the previous "List" call. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListAwrHubSourcesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. + SortBy ListAwrHubSourcesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 ListAwrHubSourcesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListAwrHubSourcesRequest) 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 ListAwrHubSourcesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListAwrHubSourcesRequest) 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 ListAwrHubSourcesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.SourceType { + if _, ok := GetMappingAwrHubSourceTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceType: %s. Supported values are: %s.", val, strings.Join(GetAwrHubSourceTypeEnumStringValues(), ","))) + } + } + + for _, val := range request.Status { + if _, ok := GetMappingAwrHubSourceStatusEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", val, strings.Join(GetAwrHubSourceStatusEnumStringValues(), ","))) + } + } + + for _, val := range request.LifecycleState { + if _, ok := GetMappingAwrHubSourceLifecycleStateEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", val, strings.Join(GetAwrHubSourceLifecycleStateEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListAwrHubSourcesSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListAwrHubSourcesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListAwrHubSourcesSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListAwrHubSourcesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListAwrHubSourcesResponse wrapper for the ListAwrHubSources operation +type ListAwrHubSourcesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of AwrHubSourceSummaryCollection instances + AwrHubSourceSummaryCollection `presentIn:"body"` + + // 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"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListAwrHubSourcesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListAwrHubSourcesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListAwrHubSourcesSortOrderEnum Enum with underlying type: string +type ListAwrHubSourcesSortOrderEnum string + +// Set of constants representing the allowable values for ListAwrHubSourcesSortOrderEnum +const ( + ListAwrHubSourcesSortOrderAsc ListAwrHubSourcesSortOrderEnum = "ASC" + ListAwrHubSourcesSortOrderDesc ListAwrHubSourcesSortOrderEnum = "DESC" +) + +var mappingListAwrHubSourcesSortOrderEnum = map[string]ListAwrHubSourcesSortOrderEnum{ + "ASC": ListAwrHubSourcesSortOrderAsc, + "DESC": ListAwrHubSourcesSortOrderDesc, +} + +var mappingListAwrHubSourcesSortOrderEnumLowerCase = map[string]ListAwrHubSourcesSortOrderEnum{ + "asc": ListAwrHubSourcesSortOrderAsc, + "desc": ListAwrHubSourcesSortOrderDesc, +} + +// GetListAwrHubSourcesSortOrderEnumValues Enumerates the set of values for ListAwrHubSourcesSortOrderEnum +func GetListAwrHubSourcesSortOrderEnumValues() []ListAwrHubSourcesSortOrderEnum { + values := make([]ListAwrHubSourcesSortOrderEnum, 0) + for _, v := range mappingListAwrHubSourcesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListAwrHubSourcesSortOrderEnumStringValues Enumerates the set of values in String for ListAwrHubSourcesSortOrderEnum +func GetListAwrHubSourcesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListAwrHubSourcesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListAwrHubSourcesSortOrderEnum(val string) (ListAwrHubSourcesSortOrderEnum, bool) { + enum, ok := mappingListAwrHubSourcesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListAwrHubSourcesSortByEnum Enum with underlying type: string +type ListAwrHubSourcesSortByEnum string + +// Set of constants representing the allowable values for ListAwrHubSourcesSortByEnum +const ( + ListAwrHubSourcesSortByTimecreated ListAwrHubSourcesSortByEnum = "timeCreated" + ListAwrHubSourcesSortByDisplayname ListAwrHubSourcesSortByEnum = "displayName" +) + +var mappingListAwrHubSourcesSortByEnum = map[string]ListAwrHubSourcesSortByEnum{ + "timeCreated": ListAwrHubSourcesSortByTimecreated, + "displayName": ListAwrHubSourcesSortByDisplayname, +} + +var mappingListAwrHubSourcesSortByEnumLowerCase = map[string]ListAwrHubSourcesSortByEnum{ + "timecreated": ListAwrHubSourcesSortByTimecreated, + "displayname": ListAwrHubSourcesSortByDisplayname, +} + +// GetListAwrHubSourcesSortByEnumValues Enumerates the set of values for ListAwrHubSourcesSortByEnum +func GetListAwrHubSourcesSortByEnumValues() []ListAwrHubSourcesSortByEnum { + values := make([]ListAwrHubSourcesSortByEnum, 0) + for _, v := range mappingListAwrHubSourcesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListAwrHubSourcesSortByEnumStringValues Enumerates the set of values in String for ListAwrHubSourcesSortByEnum +func GetListAwrHubSourcesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListAwrHubSourcesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListAwrHubSourcesSortByEnum(val string) (ListAwrHubSourcesSortByEnum, bool) { + enum, ok := mappingListAwrHubSourcesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/list_objects.go b/opsi/list_objects.go new file mode 100644 index 0000000000..2ffab42fb4 --- /dev/null +++ b/opsi/list_objects.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ListObjects List of the objects. +type ListObjects struct { + + // List of the object summary data. + Objects []ObjectSummary `mandatory:"true" json:"objects"` + + // Array comprising of all the prefixes. + Prefixes []string `mandatory:"false" json:"prefixes"` + + // Object names returned by a list query must be greater or equal to this parameter. + NextStartWith *string `mandatory:"false" json:"nextStartWith"` +} + +func (m ListObjects) String() string { + return common.PointerString(m) +} + +// 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 (m ListObjects) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/object_summary.go b/opsi/object_summary.go new file mode 100644 index 0000000000..e7e77e5464 --- /dev/null +++ b/opsi/object_summary.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ObjectSummary Summary resource object. +type ObjectSummary struct { + + // The name of the Awr Hub object. + Name *string `mandatory:"false" json:"name"` + + // Size of the Awr Hub object in bytes. + Size *int64 `mandatory:"false" json:"size"` + + // Base64-encoded MD5 hash of the Awr Hub object data. + Md5 *string `mandatory:"false" json:"md5"` + + // The time at which the resource was first created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `mandatory:"false" json:"etag"` + + // The object's storage tier. + StorageTier StorageTierEnum `mandatory:"false" json:"storageTier,omitempty"` + + // Archival state of an object for those in the archival tier. + ArchivalState ArchivalStateEnum `mandatory:"false" json:"archivalState,omitempty"` + + // The date and time the Awr Hub object was modified + TimeModified *common.SDKTime `mandatory:"false" json:"timeModified"` +} + +func (m ObjectSummary) String() string { + return common.PointerString(m) +} + +// 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 (m ObjectSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingStorageTierEnum(string(m.StorageTier)); !ok && m.StorageTier != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for StorageTier: %s. Supported values are: %s.", m.StorageTier, strings.Join(GetStorageTierEnumStringValues(), ","))) + } + if _, ok := GetMappingArchivalStateEnum(string(m.ArchivalState)); !ok && m.ArchivalState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArchivalState: %s. Supported values are: %s.", m.ArchivalState, strings.Join(GetArchivalStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/operation_type.go b/opsi/operation_type.go index b711995d59..ee3946af81 100644 --- a/opsi/operation_type.go +++ b/opsi/operation_type.go @@ -75,6 +75,12 @@ const ( OperationTypeUpdateNewsReport OperationTypeEnum = "UPDATE_NEWS_REPORT" OperationTypeMoveNewsReport OperationTypeEnum = "MOVE_NEWS_REPORT" OperationTypeDeleteNewsReport OperationTypeEnum = "DELETE_NEWS_REPORT" + OperationTypeCreateAwrhubSource OperationTypeEnum = "CREATE_AWRHUB_SOURCE" + OperationTypeDeleteAwrhubSource OperationTypeEnum = "DELETE_AWRHUB_SOURCE" + OperationTypeUpdateAwrhubSource OperationTypeEnum = "UPDATE_AWRHUB_SOURCE" + OperationTypeMoveAwrhubSource OperationTypeEnum = "MOVE_AWRHUB_SOURCE" + OperationTypeEnableAwrhubSource OperationTypeEnum = "ENABLE_AWRHUB_SOURCE" + OperationTypeDisableAwrhubSource OperationTypeEnum = "DISABLE_AWRHUB_SOURCE" ) var mappingOperationTypeEnum = map[string]OperationTypeEnum{ @@ -133,6 +139,12 @@ var mappingOperationTypeEnum = map[string]OperationTypeEnum{ "UPDATE_NEWS_REPORT": OperationTypeUpdateNewsReport, "MOVE_NEWS_REPORT": OperationTypeMoveNewsReport, "DELETE_NEWS_REPORT": OperationTypeDeleteNewsReport, + "CREATE_AWRHUB_SOURCE": OperationTypeCreateAwrhubSource, + "DELETE_AWRHUB_SOURCE": OperationTypeDeleteAwrhubSource, + "UPDATE_AWRHUB_SOURCE": OperationTypeUpdateAwrhubSource, + "MOVE_AWRHUB_SOURCE": OperationTypeMoveAwrhubSource, + "ENABLE_AWRHUB_SOURCE": OperationTypeEnableAwrhubSource, + "DISABLE_AWRHUB_SOURCE": OperationTypeDisableAwrhubSource, } var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ @@ -191,6 +203,12 @@ var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ "update_news_report": OperationTypeUpdateNewsReport, "move_news_report": OperationTypeMoveNewsReport, "delete_news_report": OperationTypeDeleteNewsReport, + "create_awrhub_source": OperationTypeCreateAwrhubSource, + "delete_awrhub_source": OperationTypeDeleteAwrhubSource, + "update_awrhub_source": OperationTypeUpdateAwrhubSource, + "move_awrhub_source": OperationTypeMoveAwrhubSource, + "enable_awrhub_source": OperationTypeEnableAwrhubSource, + "disable_awrhub_source": OperationTypeDisableAwrhubSource, } // GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum @@ -260,6 +278,12 @@ func GetOperationTypeEnumStringValues() []string { "UPDATE_NEWS_REPORT", "MOVE_NEWS_REPORT", "DELETE_NEWS_REPORT", + "CREATE_AWRHUB_SOURCE", + "DELETE_AWRHUB_SOURCE", + "UPDATE_AWRHUB_SOURCE", + "MOVE_AWRHUB_SOURCE", + "ENABLE_AWRHUB_SOURCE", + "DISABLE_AWRHUB_SOURCE", } } diff --git a/opsi/opsi_operationsinsights_client.go b/opsi/opsi_operationsinsights_client.go index 05b01a0d9b..be856f2756 100644 --- a/opsi/opsi_operationsinsights_client.go +++ b/opsi/opsi_operationsinsights_client.go @@ -219,6 +219,69 @@ func (client OperationsInsightsClient) changeAutonomousDatabaseInsightAdvancedFe return response, err } +// ChangeAwrHubSourceCompartment Moves an AwrHubSource resource from one compartment to another. When provided, If-Match is checked against ETag values of the resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ChangeAwrHubSourceCompartment.go.html to see an example of how to use ChangeAwrHubSourceCompartment API. +// A default retry strategy applies to this operation ChangeAwrHubSourceCompartment() +func (client OperationsInsightsClient) ChangeAwrHubSourceCompartment(ctx context.Context, request ChangeAwrHubSourceCompartmentRequest) (response ChangeAwrHubSourceCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.changeAwrHubSourceCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeAwrHubSourceCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeAwrHubSourceCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeAwrHubSourceCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeAwrHubSourceCompartmentResponse") + } + return +} + +// changeAwrHubSourceCompartment implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) changeAwrHubSourceCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/awrHubSources/{awrHubSourceId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeAwrHubSourceCompartmentResponse + 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/operations-insights/20200630/AwrHubSources/ChangeAwrHubSourceCompartment" + err = common.PostProcessServiceError(err, "OperationsInsights", "ChangeAwrHubSourceCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeDatabaseInsightCompartment Moves a DatabaseInsight resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource. // // # See also @@ -592,6 +655,69 @@ func (client OperationsInsightsClient) changeOperationsInsightsPrivateEndpointCo return response, err } +// ChangeOperationsInsightsWarehouseCompartment Moves a Operations Insights Warehouse resource from one compartment to another. When provided, If-Match is checked against ETag values of the resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ChangeOperationsInsightsWarehouseCompartment.go.html to see an example of how to use ChangeOperationsInsightsWarehouseCompartment API. +// A default retry strategy applies to this operation ChangeOperationsInsightsWarehouseCompartment() +func (client OperationsInsightsClient) ChangeOperationsInsightsWarehouseCompartment(ctx context.Context, request ChangeOperationsInsightsWarehouseCompartmentRequest) (response ChangeOperationsInsightsWarehouseCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.changeOperationsInsightsWarehouseCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeOperationsInsightsWarehouseCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeOperationsInsightsWarehouseCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeOperationsInsightsWarehouseCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeOperationsInsightsWarehouseCompartmentResponse") + } + return +} + +// changeOperationsInsightsWarehouseCompartment implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) changeOperationsInsightsWarehouseCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/operationsInsightsWarehouses/{operationsInsightsWarehouseId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeOperationsInsightsWarehouseCompartmentResponse + 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/operations-insights/20200630/OperationsInsightsWarehouses/ChangeOperationsInsightsWarehouseCompartment" + err = common.PostProcessServiceError(err, "OperationsInsights", "ChangeOperationsInsightsWarehouseCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeOpsiConfigurationCompartment Moves an OpsiConfiguration resource from one compartment to another. // // # See also @@ -782,6 +908,69 @@ func (client OperationsInsightsClient) createAwrHub(ctx context.Context, request return response, err } +// CreateAwrHubSource Register Awr Hub source +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/CreateAwrHubSource.go.html to see an example of how to use CreateAwrHubSource API. +// A default retry strategy applies to this operation CreateAwrHubSource() +func (client OperationsInsightsClient) CreateAwrHubSource(ctx context.Context, request CreateAwrHubSourceRequest) (response CreateAwrHubSourceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.createAwrHubSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateAwrHubSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateAwrHubSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateAwrHubSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateAwrHubSourceResponse") + } + return +} + +// createAwrHubSource implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) createAwrHubSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/awrHubSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateAwrHubSourceResponse + 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/operations-insights/20200630/AwrHubSources/CreateAwrHubSource" + err = common.PostProcessServiceError(err, "OperationsInsights", "CreateAwrHubSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateDatabaseInsight Create a Database Insight resource for a database in Operations Insights. The database will be enabled in Operations Insights. Database metric collection and analysis will be started. // // # See also @@ -1411,6 +1600,122 @@ func (client OperationsInsightsClient) deleteAwrHub(ctx context.Context, request return response, err } +// DeleteAwrHubObject Deletes an Awr Hub object. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/DeleteAwrHubObject.go.html to see an example of how to use DeleteAwrHubObject API. +// A default retry strategy applies to this operation DeleteAwrHubObject() +func (client OperationsInsightsClient) DeleteAwrHubObject(ctx context.Context, request DeleteAwrHubObjectRequest) (response DeleteAwrHubObjectResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteAwrHubObject, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteAwrHubObjectResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteAwrHubObjectResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAwrHubObjectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAwrHubObjectResponse") + } + return +} + +// deleteAwrHubObject implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) deleteAwrHubObject(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/awrHubObjects/awrHubSources/{awrHubSourceId}/o/{objectName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteAwrHubObjectResponse + 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/operations-insights/20200630/AwrHubObjects/DeleteAwrHubObject" + err = common.PostProcessServiceError(err, "OperationsInsights", "DeleteAwrHubObject", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteAwrHubSource Deletes an Awr Hub source object. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/DeleteAwrHubSource.go.html to see an example of how to use DeleteAwrHubSource API. +// A default retry strategy applies to this operation DeleteAwrHubSource() +func (client OperationsInsightsClient) DeleteAwrHubSource(ctx context.Context, request DeleteAwrHubSourceRequest) (response DeleteAwrHubSourceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteAwrHubSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteAwrHubSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteAwrHubSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAwrHubSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAwrHubSourceResponse") + } + return +} + +// deleteAwrHubSource implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) deleteAwrHubSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/awrHubSources/{awrHubSourceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteAwrHubSourceResponse + 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/operations-insights/20200630/AwrHubSources/DeleteAwrHubSource" + err = common.PostProcessServiceError(err, "OperationsInsights", "DeleteAwrHubSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteDatabaseInsight Deletes a database insight. The database insight will be deleted and cannot be enabled again. // // # See also @@ -1999,6 +2304,69 @@ func (client OperationsInsightsClient) disableAutonomousDatabaseInsightAdvancedF return response, err } +// DisableAwrHubSource Disables a Awr Hub source database in Operations Insights. This will stop the Awr data flow for the given Awr Hub source. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/DisableAwrHubSource.go.html to see an example of how to use DisableAwrHubSource API. +// A default retry strategy applies to this operation DisableAwrHubSource() +func (client OperationsInsightsClient) DisableAwrHubSource(ctx context.Context, request DisableAwrHubSourceRequest) (response DisableAwrHubSourceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.disableAwrHubSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableAwrHubSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableAwrHubSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableAwrHubSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableAwrHubSourceResponse") + } + return +} + +// disableAwrHubSource implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) disableAwrHubSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/awrHubSources/{awrHubSourceId}/actions/disable", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableAwrHubSourceResponse + 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/operations-insights/20200630/AwrHubSources/DisableAwrHubSource" + err = common.PostProcessServiceError(err, "OperationsInsights", "DisableAwrHubSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DisableDatabaseInsight Disables a database in Operations Insights. Database metric collection and analysis will be stopped. // // # See also @@ -2313,6 +2681,69 @@ func (client OperationsInsightsClient) enableAutonomousDatabaseInsightAdvancedFe return response, err } +// EnableAwrHubSource Enables a Awr Hub source database in Operations Insights. This will resume the Awr data flow for the given Awr Hub source if it was stopped earlier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/EnableAwrHubSource.go.html to see an example of how to use EnableAwrHubSource API. +// A default retry strategy applies to this operation EnableAwrHubSource() +func (client OperationsInsightsClient) EnableAwrHubSource(ctx context.Context, request EnableAwrHubSourceRequest) (response EnableAwrHubSourceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + 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.enableAwrHubSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = EnableAwrHubSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = EnableAwrHubSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(EnableAwrHubSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EnableAwrHubSourceResponse") + } + return +} + +// enableAwrHubSource implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) enableAwrHubSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/awrHubSources/{awrHubSourceId}/actions/enable", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response EnableAwrHubSourceResponse + 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/operations-insights/20200630/AwrHubSources/EnableAwrHubSource" + err = common.PostProcessServiceError(err, "OperationsInsights", "EnableAwrHubSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // EnableDatabaseInsight Enables a database in Operations Insights. Database metric collection and analysis will be started. // // # See also @@ -2545,14 +2976,130 @@ func (client OperationsInsightsClient) getAwrDatabaseReport(ctx context.Context, return nil, err } - var response GetAwrDatabaseReportResponse + var response GetAwrDatabaseReportResponse + 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/operations-insights/20200630/AwrHubs/GetAwrDatabaseReport" + err = common.PostProcessServiceError(err, "OperationsInsights", "GetAwrDatabaseReport", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAwrDatabaseSqlReport Gets the SQL health check report for one SQL of the specified database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/GetAwrDatabaseSqlReport.go.html to see an example of how to use GetAwrDatabaseSqlReport API. +// A default retry strategy applies to this operation GetAwrDatabaseSqlReport() +func (client OperationsInsightsClient) GetAwrDatabaseSqlReport(ctx context.Context, request GetAwrDatabaseSqlReportRequest) (response GetAwrDatabaseSqlReportResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAwrDatabaseSqlReport, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetAwrDatabaseSqlReportResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetAwrDatabaseSqlReportResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetAwrDatabaseSqlReportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAwrDatabaseSqlReportResponse") + } + return +} + +// getAwrDatabaseSqlReport implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) getAwrDatabaseSqlReport(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/awrHubs/{awrHubId}/awrDatabaseSqlReport", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetAwrDatabaseSqlReportResponse + 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/operations-insights/20200630/AwrHubs/GetAwrDatabaseSqlReport" + err = common.PostProcessServiceError(err, "OperationsInsights", "GetAwrDatabaseSqlReport", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetAwrHub Gets details of an AWR hub. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/GetAwrHub.go.html to see an example of how to use GetAwrHub API. +// A default retry strategy applies to this operation GetAwrHub() +func (client OperationsInsightsClient) GetAwrHub(ctx context.Context, request GetAwrHubRequest) (response GetAwrHubResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getAwrHub, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetAwrHubResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetAwrHubResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetAwrHubResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAwrHubResponse") + } + return +} + +// getAwrHub implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) getAwrHub(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/awrHubs/{awrHubId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetAwrHubResponse 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/operations-insights/20200630/AwrHubs/GetAwrDatabaseReport" - err = common.PostProcessServiceError(err, "OperationsInsights", "GetAwrDatabaseReport", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/AwrHubs/GetAwrHub" + err = common.PostProcessServiceError(err, "OperationsInsights", "GetAwrHub", apiReferenceLink) return response, err } @@ -2560,13 +3107,13 @@ func (client OperationsInsightsClient) getAwrDatabaseReport(ctx context.Context, return response, err } -// GetAwrDatabaseSqlReport Gets the SQL health check report for one SQL of the specified database. +// GetAwrHubObject Gets the Awr Hub object metadata and body. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/GetAwrDatabaseSqlReport.go.html to see an example of how to use GetAwrDatabaseSqlReport API. -// A default retry strategy applies to this operation GetAwrDatabaseSqlReport() -func (client OperationsInsightsClient) GetAwrDatabaseSqlReport(ctx context.Context, request GetAwrDatabaseSqlReportRequest) (response GetAwrDatabaseSqlReportResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/GetAwrHubObject.go.html to see an example of how to use GetAwrHubObject API. +// A default retry strategy applies to this operation GetAwrHubObject() +func (client OperationsInsightsClient) GetAwrHubObject(ctx context.Context, request GetAwrHubObjectRequest) (response GetAwrHubObjectResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2575,42 +3122,41 @@ func (client OperationsInsightsClient) GetAwrDatabaseSqlReport(ctx context.Conte if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getAwrDatabaseSqlReport, policy) + ociResponse, err = common.Retry(ctx, request, client.getAwrHubObject, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetAwrDatabaseSqlReportResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetAwrHubObjectResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetAwrDatabaseSqlReportResponse{} + response = GetAwrHubObjectResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetAwrDatabaseSqlReportResponse); ok { + if convertedResponse, ok := ociResponse.(GetAwrHubObjectResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetAwrDatabaseSqlReportResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetAwrHubObjectResponse") } return } -// getAwrDatabaseSqlReport implements the OCIOperation interface (enables retrying operations) -func (client OperationsInsightsClient) getAwrDatabaseSqlReport(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getAwrHubObject implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) getAwrHubObject(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/awrHubs/{awrHubId}/awrDatabaseSqlReport", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/awrHubObjects/awrHubSources/{awrHubSourceId}/o/{objectName}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetAwrDatabaseSqlReportResponse + var response GetAwrHubObjectResponse 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/operations-insights/20200630/AwrHubs/GetAwrDatabaseSqlReport" - err = common.PostProcessServiceError(err, "OperationsInsights", "GetAwrDatabaseSqlReport", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/AwrHubObjects/GetAwrHubObject" + err = common.PostProcessServiceError(err, "OperationsInsights", "GetAwrHubObject", apiReferenceLink) return response, err } @@ -2618,13 +3164,13 @@ func (client OperationsInsightsClient) getAwrDatabaseSqlReport(ctx context.Conte return response, err } -// GetAwrHub Gets details of an AWR hub. +// GetAwrHubSource Gets the Awr Hub source object. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/GetAwrHub.go.html to see an example of how to use GetAwrHub API. -// A default retry strategy applies to this operation GetAwrHub() -func (client OperationsInsightsClient) GetAwrHub(ctx context.Context, request GetAwrHubRequest) (response GetAwrHubResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/GetAwrHubSource.go.html to see an example of how to use GetAwrHubSource API. +// A default retry strategy applies to this operation GetAwrHubSource() +func (client OperationsInsightsClient) GetAwrHubSource(ctx context.Context, request GetAwrHubSourceRequest) (response GetAwrHubSourceResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2633,42 +3179,42 @@ func (client OperationsInsightsClient) GetAwrHub(ctx context.Context, request Ge if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getAwrHub, policy) + ociResponse, err = common.Retry(ctx, request, client.getAwrHubSource, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetAwrHubResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetAwrHubSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetAwrHubResponse{} + response = GetAwrHubSourceResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetAwrHubResponse); ok { + if convertedResponse, ok := ociResponse.(GetAwrHubSourceResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetAwrHubResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetAwrHubSourceResponse") } return } -// getAwrHub implements the OCIOperation interface (enables retrying operations) -func (client OperationsInsightsClient) getAwrHub(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getAwrHubSource implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) getAwrHubSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/awrHubs/{awrHubId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/awrHubSources/{awrHubSourceId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetAwrHubResponse + var response GetAwrHubSourceResponse 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/operations-insights/20200630/AwrHubs/GetAwrHub" - err = common.PostProcessServiceError(err, "OperationsInsights", "GetAwrHub", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/AwrHubSources/GetAwrHubSource" + err = common.PostProcessServiceError(err, "OperationsInsights", "GetAwrHubSource", apiReferenceLink) return response, err } @@ -3376,6 +3922,64 @@ func (client OperationsInsightsClient) getWorkRequest(ctx context.Context, reque return response, err } +// HeadAwrHubObject Gets the Awr Hub object's user-defined metadata and entity tag (ETag). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/HeadAwrHubObject.go.html to see an example of how to use HeadAwrHubObject API. +// A default retry strategy applies to this operation HeadAwrHubObject() +func (client OperationsInsightsClient) HeadAwrHubObject(ctx context.Context, request HeadAwrHubObjectRequest) (response HeadAwrHubObjectResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.headAwrHubObject, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = HeadAwrHubObjectResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = HeadAwrHubObjectResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(HeadAwrHubObjectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into HeadAwrHubObjectResponse") + } + return +} + +// headAwrHubObject implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) headAwrHubObject(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodHead, "/awrHubObjects/awrHubSources/{awrHubSourceId}/o/{objectName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response HeadAwrHubObjectResponse + 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/operations-insights/20200630/AwrHubObjects/HeadAwrHubObject" + err = common.PostProcessServiceError(err, "OperationsInsights", "HeadAwrHubObject", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // IngestAddmReports This endpoint takes in a JSON payload, persists it in Operation Insights ingest pipeline. // Either databaseId or id must be specified. // @@ -4350,6 +4954,122 @@ func (client OperationsInsightsClient) listAwrDatabases(ctx context.Context, req return response, err } +// ListAwrHubObjects Gets a list of Awr Hub objects. Awr Hub id needs to specified. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ListAwrHubObjects.go.html to see an example of how to use ListAwrHubObjects API. +// A default retry strategy applies to this operation ListAwrHubObjects() +func (client OperationsInsightsClient) ListAwrHubObjects(ctx context.Context, request ListAwrHubObjectsRequest) (response ListAwrHubObjectsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAwrHubObjects, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListAwrHubObjectsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListAwrHubObjectsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListAwrHubObjectsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAwrHubObjectsResponse") + } + return +} + +// listAwrHubObjects implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) listAwrHubObjects(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/awrHubObjects/awrHubSources/{awrHubSourceId}/o", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListAwrHubObjectsResponse + 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/operations-insights/20200630/AwrHubObjects/ListAwrHubObjects" + err = common.PostProcessServiceError(err, "OperationsInsights", "ListAwrHubObjects", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListAwrHubSources Gets a list of Awr Hub source objects. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ListAwrHubSources.go.html to see an example of how to use ListAwrHubSources API. +// A default retry strategy applies to this operation ListAwrHubSources() +func (client OperationsInsightsClient) ListAwrHubSources(ctx context.Context, request ListAwrHubSourcesRequest) (response ListAwrHubSourcesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listAwrHubSources, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListAwrHubSourcesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListAwrHubSourcesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListAwrHubSourcesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListAwrHubSourcesResponse") + } + return +} + +// listAwrHubSources implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) listAwrHubSources(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/awrHubSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListAwrHubSourcesResponse + 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/operations-insights/20200630/AwrHubSources/ListAwrHubSources" + err = common.PostProcessServiceError(err, "OperationsInsights", "ListAwrHubSources", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListAwrHubs Gets a list of AWR hubs. Either compartmentId or id must be specified. All these resources are expected to be in root compartment. // // # See also @@ -5878,6 +6598,74 @@ func (client OperationsInsightsClient) listWorkRequests(ctx context.Context, req return response, err } +// PutAwrHubObject Creates a new object or overwrites an existing object with the same name to the Awr Hub. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/PutAwrHubObject.go.html to see an example of how to use PutAwrHubObject API. +// A default retry strategy applies to this operation PutAwrHubObject() +func (client OperationsInsightsClient) PutAwrHubObject(ctx context.Context, request PutAwrHubObjectRequest) (response PutAwrHubObjectResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.putAwrHubObject, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PutAwrHubObjectResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PutAwrHubObjectResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PutAwrHubObjectResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PutAwrHubObjectResponse") + } + return +} + +// putAwrHubObject implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) putAwrHubObject(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/awrHubObjects/awrHubSources/{awrHubSourceId}/o/{objectName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PutAwrHubObjectResponse + var httpResponse *http.Response + var customSigner common.HTTPRequestSigner + excludeBodySigningPredicate := func(r *http.Request) bool { return false } + customSigner, err = common.NewSignerFromOCIRequestSigner(client.Signer, excludeBodySigningPredicate) + + //if there was an error overriding the signer, then use the signer from the client itself + if err != nil { + customSigner = client.Signer + } + + //Execute the request with a custom signer + httpResponse, err = client.CallWithDetails(ctx, &httpRequest, common.ClientCallDetails{Signer: customSigner}) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/AwrHubObjects/PutAwrHubObject" + err = common.PostProcessServiceError(err, "OperationsInsights", "PutAwrHubObject", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // QueryOpsiDataObjectData Queries an OPSI data object with the inputs provided and sends the result set back. Either analysisTimeInterval // or timeIntervalStart and timeIntervalEnd parameters need to be passed as well. // @@ -9102,6 +9890,64 @@ func (client OperationsInsightsClient) updateAwrHub(ctx context.Context, request return response, err } +// UpdateAwrHubSource Update Awr Hub Source object. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/UpdateAwrHubSource.go.html to see an example of how to use UpdateAwrHubSource API. +// A default retry strategy applies to this operation UpdateAwrHubSource() +func (client OperationsInsightsClient) UpdateAwrHubSource(ctx context.Context, request UpdateAwrHubSourceRequest) (response UpdateAwrHubSourceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateAwrHubSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateAwrHubSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateAwrHubSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateAwrHubSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateAwrHubSourceResponse") + } + return +} + +// updateAwrHubSource implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) updateAwrHubSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/awrHubSources/{awrHubSourceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateAwrHubSourceResponse + 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/operations-insights/20200630/AwrHubSources/UpdateAwrHubSource" + err = common.PostProcessServiceError(err, "OperationsInsights", "UpdateAwrHubSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateDatabaseInsight Updates configuration of a database insight. // // # See also diff --git a/opsi/put_awr_hub_object_request_response.go b/opsi/put_awr_hub_object_request_response.go new file mode 100644 index 0000000000..2e13781c11 --- /dev/null +++ b/opsi/put_awr_hub_object_request_response.go @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// PutAwrHubObjectRequest wrapper for the PutAwrHubObject operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/PutAwrHubObject.go.html to see an example of how to use PutAwrHubObjectRequest. +type PutAwrHubObjectRequest struct { + + // The object to be uploaded to the Awr Hub. + PutAwrHubObjectBody io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // Unique Awr Hub Object identifier + ObjectName *string `mandatory:"true" contributesTo:"path" name:"objectName"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 PutAwrHubObjectRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PutAwrHubObjectRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request PutAwrHubObjectRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.PutAwrHubObjectBody) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PutAwrHubObjectRequest) 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 PutAwrHubObjectRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PutAwrHubObjectResponse wrapper for the PutAwrHubObject operation +type PutAwrHubObjectResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-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"` + + // Content-MD5 header. + OpcContentMd5 *string `presentIn:"header" name:"opc-content-md5"` + + // The Awr Hub object modification time. + LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` + + // VersionId of the requested Awr Hub object. + VersionId *string `presentIn:"header" name:"version-id"` +} + +func (response PutAwrHubObjectResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PutAwrHubObjectResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/opsi/storage_tier.go b/opsi/storage_tier.go new file mode 100644 index 0000000000..896183dbc1 --- /dev/null +++ b/opsi/storage_tier.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// StorageTierEnum Enum with underlying type: string +type StorageTierEnum string + +// Set of constants representing the allowable values for StorageTierEnum +const ( + StorageTierStandard StorageTierEnum = "STANDARD" + StorageTierInfrequentaccess StorageTierEnum = "INFREQUENTACCESS" + StorageTierArchive StorageTierEnum = "ARCHIVE" +) + +var mappingStorageTierEnum = map[string]StorageTierEnum{ + "STANDARD": StorageTierStandard, + "INFREQUENTACCESS": StorageTierInfrequentaccess, + "ARCHIVE": StorageTierArchive, +} + +var mappingStorageTierEnumLowerCase = map[string]StorageTierEnum{ + "standard": StorageTierStandard, + "infrequentaccess": StorageTierInfrequentaccess, + "archive": StorageTierArchive, +} + +// GetStorageTierEnumValues Enumerates the set of values for StorageTierEnum +func GetStorageTierEnumValues() []StorageTierEnum { + values := make([]StorageTierEnum, 0) + for _, v := range mappingStorageTierEnum { + values = append(values, v) + } + return values +} + +// GetStorageTierEnumStringValues Enumerates the set of values in String for StorageTierEnum +func GetStorageTierEnumStringValues() []string { + return []string{ + "STANDARD", + "INFREQUENTACCESS", + "ARCHIVE", + } +} + +// GetMappingStorageTierEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingStorageTierEnum(val string) (StorageTierEnum, bool) { + enum, ok := mappingStorageTierEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/update_awr_hub_source_details.go b/opsi/update_awr_hub_source_details.go new file mode 100644 index 0000000000..8b26dad310 --- /dev/null +++ b/opsi/update_awr_hub_source_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, 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. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateAwrHubSourceDetails Awr hub source update object information +type UpdateAwrHubSourceDetails struct { + + // source type of the database + Type AwrHubSourceTypeEnum `mandatory:"false" json:"type,omitempty"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateAwrHubSourceDetails) String() string { + return common.PointerString(m) +} + +// 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 (m UpdateAwrHubSourceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingAwrHubSourceTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetAwrHubSourceTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/update_awr_hub_source_request_response.go b/opsi/update_awr_hub_source_request_response.go new file mode 100644 index 0000000000..df7555ae6a --- /dev/null +++ b/opsi/update_awr_hub_source_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, 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 opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateAwrHubSourceRequest wrapper for the UpdateAwrHubSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/UpdateAwrHubSource.go.html to see an example of how to use UpdateAwrHubSourceRequest. +type UpdateAwrHubSourceRequest struct { + + // The configuration to be updated. + UpdateAwrHubSourceDetails `contributesTo:"body"` + + // Unique Awr Hub Source identifier + AwrHubSourceId *string `mandatory:"true" contributesTo:"path" name:"awrHubSourceId"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 UpdateAwrHubSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateAwrHubSourceRequest) 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 UpdateAwrHubSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateAwrHubSourceRequest) 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 UpdateAwrHubSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateAwrHubSourceResponse wrapper for the UpdateAwrHubSource operation +type UpdateAwrHubSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + 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 UpdateAwrHubSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateAwrHubSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/psql/psql_postgresql_client.go b/psql/psql_postgresql_client.go index c3045e053e..f957607a25 100644 --- a/psql/psql_postgresql_client.go +++ b/psql/psql_postgresql_client.go @@ -145,7 +145,7 @@ func (client PostgresqlClient) changeBackupCompartment(ctx context.Context, requ defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/Backup/ChangeBackupCompartment" err = common.PostProcessServiceError(err, "Postgresql", "ChangeBackupCompartment", apiReferenceLink) return response, err } @@ -208,7 +208,7 @@ func (client PostgresqlClient) changeConfigurationCompartment(ctx context.Contex defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/Configuration/ChangeConfigurationCompartment" err = common.PostProcessServiceError(err, "Postgresql", "ChangeConfigurationCompartment", apiReferenceLink) return response, err } @@ -271,7 +271,7 @@ func (client PostgresqlClient) changeDbSystemCompartment(ctx context.Context, re defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/ChangeDbSystemCompartment" err = common.PostProcessServiceError(err, "Postgresql", "ChangeDbSystemCompartment", apiReferenceLink) return response, err } @@ -334,7 +334,7 @@ func (client PostgresqlClient) createBackup(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/Backup/CreateBackup" err = common.PostProcessServiceError(err, "Postgresql", "CreateBackup", apiReferenceLink) return response, err } @@ -397,7 +397,7 @@ func (client PostgresqlClient) createConfiguration(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/Configuration/CreateConfiguration" err = common.PostProcessServiceError(err, "Postgresql", "CreateConfiguration", apiReferenceLink) return response, err } @@ -460,7 +460,7 @@ func (client PostgresqlClient) createDbSystem(ctx context.Context, request commo defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/CreateDbSystem" err = common.PostProcessServiceError(err, "Postgresql", "CreateDbSystem", apiReferenceLink) return response, err } @@ -518,7 +518,7 @@ func (client PostgresqlClient) deleteBackup(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/Backup/DeleteBackup" err = common.PostProcessServiceError(err, "Postgresql", "DeleteBackup", apiReferenceLink) return response, err } @@ -576,7 +576,7 @@ func (client PostgresqlClient) deleteConfiguration(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/Configuration/DeleteConfiguration" err = common.PostProcessServiceError(err, "Postgresql", "DeleteConfiguration", apiReferenceLink) return response, err } @@ -634,7 +634,7 @@ func (client PostgresqlClient) deleteDbSystem(ctx context.Context, request commo defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/DeleteDbSystem" err = common.PostProcessServiceError(err, "Postgresql", "DeleteDbSystem", apiReferenceLink) return response, err } @@ -697,7 +697,7 @@ func (client PostgresqlClient) failoverDbSystem(ctx context.Context, request com defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/FailoverDbSystem" err = common.PostProcessServiceError(err, "Postgresql", "FailoverDbSystem", apiReferenceLink) return response, err } @@ -755,7 +755,7 @@ func (client PostgresqlClient) getBackup(ctx context.Context, request common.OCI defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/Backup/GetBackup" err = common.PostProcessServiceError(err, "Postgresql", "GetBackup", apiReferenceLink) return response, err } @@ -813,7 +813,7 @@ func (client PostgresqlClient) getConfiguration(ctx context.Context, request com defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/Configuration/GetConfiguration" err = common.PostProcessServiceError(err, "Postgresql", "GetConfiguration", apiReferenceLink) return response, err } @@ -871,7 +871,7 @@ func (client PostgresqlClient) getConnectionDetails(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/ConnectionDetails/GetConnectionDetails" err = common.PostProcessServiceError(err, "Postgresql", "GetConnectionDetails", apiReferenceLink) return response, err } @@ -929,7 +929,7 @@ func (client PostgresqlClient) getDbSystem(ctx context.Context, request common.O defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/GetDbSystem" err = common.PostProcessServiceError(err, "Postgresql", "GetDbSystem", apiReferenceLink) return response, err } @@ -987,7 +987,7 @@ func (client PostgresqlClient) getDefaultConfiguration(ctx context.Context, requ defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DefaultConfiguration/GetDefaultConfiguration" err = common.PostProcessServiceError(err, "Postgresql", "GetDefaultConfiguration", apiReferenceLink) return response, err } @@ -1045,7 +1045,7 @@ func (client PostgresqlClient) getPrimaryDbInstance(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/GetPrimaryDbInstance" err = common.PostProcessServiceError(err, "Postgresql", "GetPrimaryDbInstance", apiReferenceLink) return response, err } @@ -1103,7 +1103,7 @@ func (client PostgresqlClient) getWorkRequest(ctx context.Context, request commo defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/WorkRequest/GetWorkRequest" err = common.PostProcessServiceError(err, "Postgresql", "GetWorkRequest", apiReferenceLink) return response, err } @@ -1161,7 +1161,7 @@ func (client PostgresqlClient) listBackups(ctx context.Context, request common.O defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/BackupCollection/ListBackups" err = common.PostProcessServiceError(err, "Postgresql", "ListBackups", apiReferenceLink) return response, err } @@ -1219,7 +1219,7 @@ func (client PostgresqlClient) listConfigurations(ctx context.Context, request c defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/ConfigurationCollection/ListConfigurations" err = common.PostProcessServiceError(err, "Postgresql", "ListConfigurations", apiReferenceLink) return response, err } @@ -1277,7 +1277,7 @@ func (client PostgresqlClient) listDbSystems(ctx context.Context, request common defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystemCollection/ListDbSystems" err = common.PostProcessServiceError(err, "Postgresql", "ListDbSystems", apiReferenceLink) return response, err } @@ -1335,7 +1335,7 @@ func (client PostgresqlClient) listDefaultConfigurations(ctx context.Context, re defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DefaultConfigurationCollection/ListDefaultConfigurations" err = common.PostProcessServiceError(err, "Postgresql", "ListDefaultConfigurations", apiReferenceLink) return response, err } @@ -1393,7 +1393,7 @@ func (client PostgresqlClient) listShapes(ctx context.Context, request common.OC defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/ShapeSummary/ListShapes" err = common.PostProcessServiceError(err, "Postgresql", "ListShapes", apiReferenceLink) return response, err } @@ -1451,7 +1451,7 @@ func (client PostgresqlClient) listWorkRequestErrors(ctx context.Context, reques defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/WorkRequestError/ListWorkRequestErrors" err = common.PostProcessServiceError(err, "Postgresql", "ListWorkRequestErrors", apiReferenceLink) return response, err } @@ -1509,7 +1509,7 @@ func (client PostgresqlClient) listWorkRequestLogs(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/WorkRequestLogEntry/ListWorkRequestLogs" err = common.PostProcessServiceError(err, "Postgresql", "ListWorkRequestLogs", apiReferenceLink) return response, err } @@ -1567,7 +1567,7 @@ func (client PostgresqlClient) listWorkRequests(ctx context.Context, request com defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/WorkRequest/ListWorkRequests" err = common.PostProcessServiceError(err, "Postgresql", "ListWorkRequests", apiReferenceLink) return response, err } @@ -1625,7 +1625,7 @@ func (client PostgresqlClient) patchDbSystem(ctx context.Context, request common defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/PatchDbSystem" err = common.PostProcessServiceError(err, "Postgresql", "PatchDbSystem", apiReferenceLink) return response, err } @@ -1688,7 +1688,7 @@ func (client PostgresqlClient) resetMasterUserPassword(ctx context.Context, requ defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/ResetMasterUserPassword" err = common.PostProcessServiceError(err, "Postgresql", "ResetMasterUserPassword", apiReferenceLink) return response, err } @@ -1751,7 +1751,7 @@ func (client PostgresqlClient) restartDbInstanceInDbSystem(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/RestartDbInstanceInDbSystem" err = common.PostProcessServiceError(err, "Postgresql", "RestartDbInstanceInDbSystem", apiReferenceLink) return response, err } @@ -1814,7 +1814,7 @@ func (client PostgresqlClient) restoreDbSystem(ctx context.Context, request comm defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/RestoreDbSystem" err = common.PostProcessServiceError(err, "Postgresql", "RestoreDbSystem", apiReferenceLink) return response, err } @@ -1872,7 +1872,7 @@ func (client PostgresqlClient) updateBackup(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/Backup/UpdateBackup" err = common.PostProcessServiceError(err, "Postgresql", "UpdateBackup", apiReferenceLink) return response, err } @@ -1935,7 +1935,7 @@ func (client PostgresqlClient) updateConfiguration(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/Configuration/UpdateConfiguration" err = common.PostProcessServiceError(err, "Postgresql", "UpdateConfiguration", apiReferenceLink) return response, err } @@ -1998,7 +1998,7 @@ func (client PostgresqlClient) updateDbSystem(ctx context.Context, request commo defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/UpdateDbSystem" err = common.PostProcessServiceError(err, "Postgresql", "UpdateDbSystem", apiReferenceLink) return response, err } @@ -2061,7 +2061,7 @@ func (client PostgresqlClient) updateDbSystemDbInstance(ctx context.Context, req defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/postgresql/20220915/DbSystem/UpdateDbSystemDbInstance" err = common.PostProcessServiceError(err, "Postgresql", "UpdateDbSystemDbInstance", apiReferenceLink) return response, err }