diff --git a/CHANGELOG.md b/CHANGELOG.md index ce16e11f2d..8bc1ef89e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.40.0 - 2023-05-30 +### Added +- Support for policy-based snapshots in the File Storage service +- Support for creating and updating a VM cluster network with disaster recovery network support in the Database service +- Support for setting a management dashboard or saved search to be shared across OCI Observability and Management services in the Management Dashboard service + +### Breaking Changes +- The property `Port` was deprecated and made optional in the `ScanDetails` model in the Database service + + ## 65.39.0 - 2023-05-23 ### Added - Support for CRI-O parsing in the Logging service diff --git a/common/configuration.go b/common/configuration.go index 4176535cd1..4cd1d7edd1 100644 --- a/common/configuration.go +++ b/common/configuration.go @@ -12,6 +12,7 @@ import ( "path/filepath" "regexp" "strings" + "sync" ) // AuthenticationType for auth @@ -47,6 +48,23 @@ type ConfigurationProvider interface { AuthType() (AuthConfig, error) } +var fileMutex = sync.Mutex{} +var fileCache = make(map[string][]byte) + +func readFile(filename string) ([]byte, error) { + fileMutex.Lock() + defer fileMutex.Unlock() + val, ok := fileCache[filename] + if ok { + return val, nil + } + val, err := ioutil.ReadFile(filename) + if err == nil { + fileCache[filename] = val + } + return val, err +} + // IsConfigurationProviderValid Tests all parts of the configuration provider do not return an error, this method will // not check AuthType(), since authType() is not required to be there. func IsConfigurationProviderValid(conf ConfigurationProvider) (ok bool, err error) { @@ -161,7 +179,7 @@ func (p environmentConfigurationProvider) PrivateRSAKey() (key *rsa.PrivateKey, } expandedPath := expandPath(value) - pemFileContent, err := ioutil.ReadFile(expandedPath) + pemFileContent, err := readFile(expandedPath) if err != nil { Debugln("Can not read PrivateKey location from environment variable: " + environmentVariable) return @@ -252,6 +270,9 @@ type fileConfigurationProvider struct { //ConfigFileInfo FileInfo *configFileInfo + + //Mutex to protect the config file + configMux sync.Mutex } type fileConfigurationProviderError struct { @@ -272,7 +293,8 @@ func ConfigurationProviderFromFile(configFilePath, privateKeyPassword string) (C return fileConfigurationProvider{ ConfigPath: configFilePath, PrivateKeyPassword: privateKeyPassword, - Profile: "DEFAULT"}, nil + Profile: "DEFAULT", + configMux: sync.Mutex{}}, nil } // ConfigurationProviderFromFileWithProfile creates a configuration provider from a configuration file @@ -285,7 +307,8 @@ func ConfigurationProviderFromFileWithProfile(configFilePath, profile, privateKe return fileConfigurationProvider{ ConfigPath: configFilePath, PrivateKeyPassword: privateKeyPassword, - Profile: profile}, nil + Profile: profile, + configMux: sync.Mutex{}}, nil } type configFileInfo struct { @@ -392,7 +415,7 @@ func expandPath(filename string) (expandedPath string) { func openConfigFile(configFilePath string) (data []byte, err error) { expandedPath := expandPath(configFilePath) - data, err = ioutil.ReadFile(expandedPath) + data, err = readFile(expandedPath) if err != nil { err = fmt.Errorf("can not read config file: %s due to: %s", configFilePath, err.Error()) } @@ -405,6 +428,8 @@ func (p fileConfigurationProvider) String() string { } func (p fileConfigurationProvider) readAndParseConfigFile() (info *configFileInfo, err error) { + p.configMux.Lock() + defer p.configMux.Unlock() if p.FileInfo != nil { return p.FileInfo, nil } @@ -522,7 +547,7 @@ func (p fileConfigurationProvider) PrivateRSAKey() (key *rsa.PrivateKey, err err } expandedPath := expandPath(filePath) - pemFileContent, err := ioutil.ReadFile(expandedPath) + pemFileContent, err := readFile(expandedPath) if err != nil { err = fileConfigurationProviderError{err: fmt.Errorf("can not read PrivateKey from configuration file due to: %s", err.Error())} return @@ -585,7 +610,7 @@ func (p fileConfigurationProvider) AuthType() (AuthConfig, error) { func getTokenContent(filePath string) (string, error) { expandedPath := expandPath(filePath) - tokenFileContent, err := ioutil.ReadFile(expandedPath) + tokenFileContent, err := readFile(expandedPath) if err != nil { err = fileConfigurationProviderError{err: fmt.Errorf("can not read token content from configuration file due to: %s", err.Error())} return "", err @@ -620,6 +645,7 @@ func (c composingConfigurationProvider) TenancyOCID() (string, error) { if err == nil { return val, nil } + Debugf("did not find a proper configuration for tenancy, err: %v", err) } return "", fmt.Errorf("did not find a proper configuration for tenancy") } @@ -630,6 +656,7 @@ func (c composingConfigurationProvider) UserOCID() (string, error) { if err == nil { return val, nil } + Debugf("did not find a proper configuration for keyFingerprint, err: %v", err) } return "", fmt.Errorf("did not find a proper configuration for user") } diff --git a/common/configuration_test.go b/common/configuration_test.go index d1e6f4fecb..4167ae24c7 100644 --- a/common/configuration_test.go +++ b/common/configuration_test.go @@ -556,6 +556,56 @@ security_token_file=%s assert.NoError(t, e1) } +func TestFileConfigurationProvider_ConcurrentRead(t *testing.T) { + dataTpl := `[DEFAULT] +user=someuser +fingerprint=somefingerprint +key_file=%s +tenancy=sometenancy +compartment = somecompartment +region=someregion +` + + tmpKeyLocation := filepath.Join(getHomeFolder(), "testKeyForConcurrentRead") + e := ioutil.WriteFile(tmpKeyLocation, []byte(testEncryptedPrivateKeyConf), 777) + if e != nil { + assert.FailNow(t, e.Error()) + } + + newLocation := strings.Replace(tmpKeyLocation, getHomeFolder(), "~/", 1) + data := fmt.Sprintf(dataTpl, newLocation) + tmpConfFile := writeTempFile(data) + + defer removeFileFn(tmpConfFile) + defer removeFileFn(tmpKeyLocation) + + maxGoroutines := 10 + guard := make(chan struct{}, maxGoroutines) + + for i := 0; i < 30; i++ { + guard <- struct{}{} // would block if guard channel is already filled + go func(n int) { + provider, err := ConfigurationProviderFromFile(tmpConfFile, testKeyPassphrase) + assert.NoError(t, err) + ok, err := IsConfigurationProviderValid(provider) + assert.NoError(t, err) + assert.True(t, ok) + + fns := []func() (string, error){provider.TenancyOCID, provider.UserOCID, provider.KeyFingerprint} + for _, fn := range fns { + val, e := fn() + assert.NoError(t, e) + assert.NotEmpty(t, val) + } + + key, err := provider.PrivateRSAKey() + assert.NoError(t, err) + assert.NotNil(t, key) + <-guard + }(i) + } +} + func TestComposingConfigurationProvider_MultipleFiles(t *testing.T) { dataTpl0 := `` dataTpl := `[DEFAULT] diff --git a/common/version.go b/common/version.go index cb0edb4feb..06b3a5757f 100644 --- a/common/version.go +++ b/common/version.go @@ -12,7 +12,7 @@ import ( const ( major = "65" - minor = "39" + minor = "40" patch = "0" tag = "" ) diff --git a/database/dr_scan_details.go b/database/dr_scan_details.go new file mode 100644 index 0000000000..9435980cd2 --- /dev/null +++ b/database/dr_scan_details.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" +) + +// DrScanDetails The Single Client Access Name (SCAN) details for Disaster recovery network. +type DrScanDetails struct { + + // The Disaster recovery SCAN hostname. + Hostname *string `mandatory:"true" json:"hostname"` + + // The Disaster recovery SCAN TCPIP port. Default is 1521. + ScanListenerPortTcp *int `mandatory:"true" json:"scanListenerPortTcp"` + + // The list of Disaster recovery SCAN IP addresses. Three addresses should be provided. + Ips []string `mandatory:"true" json:"ips"` +} + +func (m DrScanDetails) 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 DrScanDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/generate_recommended_network_details.go b/database/generate_recommended_network_details.go index 8eb3005e5e..5f2ab61322 100644 --- a/database/generate_recommended_network_details.go +++ b/database/generate_recommended_network_details.go @@ -36,6 +36,9 @@ type GenerateRecommendedNetworkDetails struct { // The SCAN TCPIP SSL port. Default is 2484. ScanListenerPortTcpSsl *int `mandatory:"false" json:"scanListenerPortTcpSsl"` + // The DR SCAN TCPIP port. Default is 1521. + DrScanListenerPortTcp *int `mandatory:"false" json:"drScanListenerPortTcp"` + // The list of DNS server IP addresses. Maximum of 3 allowed. Dns []string `mandatory:"false" json:"dns"` diff --git a/database/info_for_network_gen_details.go b/database/info_for_network_gen_details.go index 7db682dee4..35106e7ed7 100644 --- a/database/info_for_network_gen_details.go +++ b/database/info_for_network_gen_details.go @@ -64,18 +64,21 @@ type InfoForNetworkGenDetailsNetworkTypeEnum string // Set of constants representing the allowable values for InfoForNetworkGenDetailsNetworkTypeEnum const ( - InfoForNetworkGenDetailsNetworkTypeClient InfoForNetworkGenDetailsNetworkTypeEnum = "CLIENT" - InfoForNetworkGenDetailsNetworkTypeBackup InfoForNetworkGenDetailsNetworkTypeEnum = "BACKUP" + InfoForNetworkGenDetailsNetworkTypeClient InfoForNetworkGenDetailsNetworkTypeEnum = "CLIENT" + InfoForNetworkGenDetailsNetworkTypeBackup InfoForNetworkGenDetailsNetworkTypeEnum = "BACKUP" + InfoForNetworkGenDetailsNetworkTypeDisasterRecovery InfoForNetworkGenDetailsNetworkTypeEnum = "DISASTER_RECOVERY" ) var mappingInfoForNetworkGenDetailsNetworkTypeEnum = map[string]InfoForNetworkGenDetailsNetworkTypeEnum{ - "CLIENT": InfoForNetworkGenDetailsNetworkTypeClient, - "BACKUP": InfoForNetworkGenDetailsNetworkTypeBackup, + "CLIENT": InfoForNetworkGenDetailsNetworkTypeClient, + "BACKUP": InfoForNetworkGenDetailsNetworkTypeBackup, + "DISASTER_RECOVERY": InfoForNetworkGenDetailsNetworkTypeDisasterRecovery, } var mappingInfoForNetworkGenDetailsNetworkTypeEnumLowerCase = map[string]InfoForNetworkGenDetailsNetworkTypeEnum{ - "client": InfoForNetworkGenDetailsNetworkTypeClient, - "backup": InfoForNetworkGenDetailsNetworkTypeBackup, + "client": InfoForNetworkGenDetailsNetworkTypeClient, + "backup": InfoForNetworkGenDetailsNetworkTypeBackup, + "disaster_recovery": InfoForNetworkGenDetailsNetworkTypeDisasterRecovery, } // GetInfoForNetworkGenDetailsNetworkTypeEnumValues Enumerates the set of values for InfoForNetworkGenDetailsNetworkTypeEnum @@ -92,6 +95,7 @@ func GetInfoForNetworkGenDetailsNetworkTypeEnumStringValues() []string { return []string{ "CLIENT", "BACKUP", + "DISASTER_RECOVERY", } } diff --git a/database/network_bonding_mode_details.go b/database/network_bonding_mode_details.go index 41aadece96..b57e30aaf7 100644 --- a/database/network_bonding_mode_details.go +++ b/database/network_bonding_mode_details.go @@ -15,7 +15,7 @@ import ( "strings" ) -// NetworkBondingModeDetails Details of bonding mode for Client and Backup networks of an Exadata infrastructure. +// NetworkBondingModeDetails Details of bonding mode for Client and Backup and DR networks of an Exadata infrastructure. type NetworkBondingModeDetails struct { // The network bonding mode for the Exadata infrastructure. @@ -23,6 +23,9 @@ type NetworkBondingModeDetails struct { // The network bonding mode for the Exadata infrastructure. BackupNetworkBondingMode NetworkBondingModeDetailsBackupNetworkBondingModeEnum `mandatory:"false" json:"backupNetworkBondingMode,omitempty"` + + // The network bonding mode for the Exadata infrastructure. + DrNetworkBondingMode NetworkBondingModeDetailsDrNetworkBondingModeEnum `mandatory:"false" json:"drNetworkBondingMode,omitempty"` } func (m NetworkBondingModeDetails) String() string { @@ -41,6 +44,9 @@ func (m NetworkBondingModeDetails) ValidateEnumValue() (bool, error) { if _, ok := GetMappingNetworkBondingModeDetailsBackupNetworkBondingModeEnum(string(m.BackupNetworkBondingMode)); !ok && m.BackupNetworkBondingMode != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackupNetworkBondingMode: %s. Supported values are: %s.", m.BackupNetworkBondingMode, strings.Join(GetNetworkBondingModeDetailsBackupNetworkBondingModeEnumStringValues(), ","))) } + if _, ok := GetMappingNetworkBondingModeDetailsDrNetworkBondingModeEnum(string(m.DrNetworkBondingMode)); !ok && m.DrNetworkBondingMode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DrNetworkBondingMode: %s. Supported values are: %s.", m.DrNetworkBondingMode, strings.Join(GetNetworkBondingModeDetailsDrNetworkBondingModeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -130,3 +136,45 @@ func GetMappingNetworkBondingModeDetailsBackupNetworkBondingModeEnum(val string) enum, ok := mappingNetworkBondingModeDetailsBackupNetworkBondingModeEnumLowerCase[strings.ToLower(val)] return enum, ok } + +// NetworkBondingModeDetailsDrNetworkBondingModeEnum Enum with underlying type: string +type NetworkBondingModeDetailsDrNetworkBondingModeEnum string + +// Set of constants representing the allowable values for NetworkBondingModeDetailsDrNetworkBondingModeEnum +const ( + NetworkBondingModeDetailsDrNetworkBondingModeActiveBackup NetworkBondingModeDetailsDrNetworkBondingModeEnum = "ACTIVE_BACKUP" + NetworkBondingModeDetailsDrNetworkBondingModeLacp NetworkBondingModeDetailsDrNetworkBondingModeEnum = "LACP" +) + +var mappingNetworkBondingModeDetailsDrNetworkBondingModeEnum = map[string]NetworkBondingModeDetailsDrNetworkBondingModeEnum{ + "ACTIVE_BACKUP": NetworkBondingModeDetailsDrNetworkBondingModeActiveBackup, + "LACP": NetworkBondingModeDetailsDrNetworkBondingModeLacp, +} + +var mappingNetworkBondingModeDetailsDrNetworkBondingModeEnumLowerCase = map[string]NetworkBondingModeDetailsDrNetworkBondingModeEnum{ + "active_backup": NetworkBondingModeDetailsDrNetworkBondingModeActiveBackup, + "lacp": NetworkBondingModeDetailsDrNetworkBondingModeLacp, +} + +// GetNetworkBondingModeDetailsDrNetworkBondingModeEnumValues Enumerates the set of values for NetworkBondingModeDetailsDrNetworkBondingModeEnum +func GetNetworkBondingModeDetailsDrNetworkBondingModeEnumValues() []NetworkBondingModeDetailsDrNetworkBondingModeEnum { + values := make([]NetworkBondingModeDetailsDrNetworkBondingModeEnum, 0) + for _, v := range mappingNetworkBondingModeDetailsDrNetworkBondingModeEnum { + values = append(values, v) + } + return values +} + +// GetNetworkBondingModeDetailsDrNetworkBondingModeEnumStringValues Enumerates the set of values in String for NetworkBondingModeDetailsDrNetworkBondingModeEnum +func GetNetworkBondingModeDetailsDrNetworkBondingModeEnumStringValues() []string { + return []string{ + "ACTIVE_BACKUP", + "LACP", + } +} + +// GetMappingNetworkBondingModeDetailsDrNetworkBondingModeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNetworkBondingModeDetailsDrNetworkBondingModeEnum(val string) (NetworkBondingModeDetailsDrNetworkBondingModeEnum, bool) { + enum, ok := mappingNetworkBondingModeDetailsDrNetworkBondingModeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/scan_details.go b/database/scan_details.go index a5de7eefb6..11cdebd465 100644 --- a/database/scan_details.go +++ b/database/scan_details.go @@ -21,12 +21,13 @@ type ScanDetails struct { // The SCAN hostname. Hostname *string `mandatory:"true" json:"hostname"` - // The SCAN TCPIP port. Default is 1521. - Port *int `mandatory:"true" json:"port"` - // The list of SCAN IP addresses. Three addresses should be provided. Ips []string `mandatory:"true" json:"ips"` + // **Deprecated.** This field is deprecated. You may use 'scanListenerPortTcp' to specify the port. + // The SCAN TCPIP port. Default is 1521. + Port *int `mandatory:"false" json:"port"` + // The SCAN TCPIP port. Default is 1521. ScanListenerPortTcp *int `mandatory:"false" json:"scanListenerPortTcp"` diff --git a/database/update_vm_cluster_network_details.go b/database/update_vm_cluster_network_details.go index c440830455..39d1bcab94 100644 --- a/database/update_vm_cluster_network_details.go +++ b/database/update_vm_cluster_network_details.go @@ -30,6 +30,9 @@ type UpdateVmClusterNetworkDetails struct { // Details of the client and backup networks. VmNetworks []VmNetworkDetails `mandatory:"false" json:"vmNetworks"` + // The SCAN details for DR network + DrScans []DrScanDetails `mandatory:"false" json:"drScans"` + // 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/database/vm_cluster_network.go b/database/vm_cluster_network.go index 6bacaa7114..49f13c4aa7 100644 --- a/database/vm_cluster_network.go +++ b/database/vm_cluster_network.go @@ -45,6 +45,9 @@ type VmClusterNetwork struct { // Details of the client and backup networks. VmNetworks []VmNetworkDetails `mandatory:"false" json:"vmNetworks"` + // The SCAN details for DR network + DrScans []DrScanDetails `mandatory:"false" json:"drScans"` + // The current state of the VM cluster network. // CREATING - The resource is being created // REQUIRES_VALIDATION - The resource is created and may not be usable until it is validated. diff --git a/database/vm_cluster_network_details.go b/database/vm_cluster_network_details.go index 9cd7388cdc..a6642d4421 100644 --- a/database/vm_cluster_network_details.go +++ b/database/vm_cluster_network_details.go @@ -36,6 +36,9 @@ type VmClusterNetworkDetails struct { // The list of NTP server IP addresses. Maximum of 3 allowed. Ntp []string `mandatory:"false" json:"ntp"` + // The SCAN details for DR network + DrScans []DrScanDetails `mandatory:"false" json:"drScans"` + // 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/database/vm_cluster_network_summary.go b/database/vm_cluster_network_summary.go index acda58bdff..c7f89eaa54 100644 --- a/database/vm_cluster_network_summary.go +++ b/database/vm_cluster_network_summary.go @@ -45,6 +45,9 @@ type VmClusterNetworkSummary struct { // Details of the client and backup networks. VmNetworks []VmNetworkDetails `mandatory:"false" json:"vmNetworks"` + // The SCAN details for DR network + DrScans []DrScanDetails `mandatory:"false" json:"drScans"` + // The current state of the VM cluster network. // CREATING - The resource is being created // REQUIRES_VALIDATION - The resource is created and may not be usable until it is validated. diff --git a/database/vm_network_details.go b/database/vm_network_details.go index fbae8cc8ad..a44c49dd3a 100644 --- a/database/vm_network_details.go +++ b/database/vm_network_details.go @@ -61,18 +61,21 @@ type VmNetworkDetailsNetworkTypeEnum string // Set of constants representing the allowable values for VmNetworkDetailsNetworkTypeEnum const ( - VmNetworkDetailsNetworkTypeClient VmNetworkDetailsNetworkTypeEnum = "CLIENT" - VmNetworkDetailsNetworkTypeBackup VmNetworkDetailsNetworkTypeEnum = "BACKUP" + VmNetworkDetailsNetworkTypeClient VmNetworkDetailsNetworkTypeEnum = "CLIENT" + VmNetworkDetailsNetworkTypeBackup VmNetworkDetailsNetworkTypeEnum = "BACKUP" + VmNetworkDetailsNetworkTypeDisasterRecovery VmNetworkDetailsNetworkTypeEnum = "DISASTER_RECOVERY" ) var mappingVmNetworkDetailsNetworkTypeEnum = map[string]VmNetworkDetailsNetworkTypeEnum{ - "CLIENT": VmNetworkDetailsNetworkTypeClient, - "BACKUP": VmNetworkDetailsNetworkTypeBackup, + "CLIENT": VmNetworkDetailsNetworkTypeClient, + "BACKUP": VmNetworkDetailsNetworkTypeBackup, + "DISASTER_RECOVERY": VmNetworkDetailsNetworkTypeDisasterRecovery, } var mappingVmNetworkDetailsNetworkTypeEnumLowerCase = map[string]VmNetworkDetailsNetworkTypeEnum{ - "client": VmNetworkDetailsNetworkTypeClient, - "backup": VmNetworkDetailsNetworkTypeBackup, + "client": VmNetworkDetailsNetworkTypeClient, + "backup": VmNetworkDetailsNetworkTypeBackup, + "disaster_recovery": VmNetworkDetailsNetworkTypeDisasterRecovery, } // GetVmNetworkDetailsNetworkTypeEnumValues Enumerates the set of values for VmNetworkDetailsNetworkTypeEnum @@ -89,6 +92,7 @@ func GetVmNetworkDetailsNetworkTypeEnumStringValues() []string { return []string{ "CLIENT", "BACKUP", + "DISASTER_RECOVERY", } } diff --git a/filestorage/change_filesystem_snapshot_policy_compartment_details.go b/filestorage/change_filesystem_snapshot_policy_compartment_details.go new file mode 100644 index 0000000000..ea9fc8a34e --- /dev/null +++ b/filestorage/change_filesystem_snapshot_policy_compartment_details.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. + +// File Storage API +// +// Use the File Storage service API to manage file systems, mount targets, and snapshots. +// For more information, see Overview of File Storage (https://docs.cloud.oracle.com/iaas/Content/File/Concepts/filestorageoverview.htm). +// + +package filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeFilesystemSnapshotPolicyCompartmentDetails Details for changing the compartment of a file system snapshot policy. +type ChangeFilesystemSnapshotPolicyCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the file system snapshot policy to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeFilesystemSnapshotPolicyCompartmentDetails) 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 ChangeFilesystemSnapshotPolicyCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/filestorage/change_filesystem_snapshot_policy_compartment_request_response.go b/filestorage/change_filesystem_snapshot_policy_compartment_request_response.go new file mode 100644 index 0000000000..924d13425e --- /dev/null +++ b/filestorage/change_filesystem_snapshot_policy_compartment_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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeFilesystemSnapshotPolicyCompartmentRequest wrapper for the ChangeFilesystemSnapshotPolicyCompartment operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/ChangeFilesystemSnapshotPolicyCompartment.go.html to see an example of how to use ChangeFilesystemSnapshotPolicyCompartmentRequest. +type ChangeFilesystemSnapshotPolicyCompartmentRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy. + FilesystemSnapshotPolicyId *string `mandatory:"true" contributesTo:"path" name:"filesystemSnapshotPolicyId"` + + // Details for changing the compartment of a file system snapshot policy. + ChangeFilesystemSnapshotPolicyCompartmentDetails `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 ChangeFilesystemSnapshotPolicyCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeFilesystemSnapshotPolicyCompartmentRequest) 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 ChangeFilesystemSnapshotPolicyCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeFilesystemSnapshotPolicyCompartmentRequest) 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 ChangeFilesystemSnapshotPolicyCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeFilesystemSnapshotPolicyCompartmentResponse wrapper for the ChangeFilesystemSnapshotPolicyCompartment operation +type ChangeFilesystemSnapshotPolicyCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeFilesystemSnapshotPolicyCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeFilesystemSnapshotPolicyCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/filestorage/client_options.go b/filestorage/client_options.go index 9edabbee7f..7a92f3039c 100644 --- a/filestorage/client_options.go +++ b/filestorage/client_options.go @@ -36,7 +36,7 @@ type ClientOptions struct { RequirePrivilegedSourcePort *bool `mandatory:"false" json:"requirePrivilegedSourcePort"` // Type of access to grant clients using the file system - // through this export. If unspecified defaults to `READ_ONLY`. + // through this export. If unspecified defaults to `READ_WRITE`. Access ClientOptionsAccessEnum `mandatory:"false" json:"access,omitempty"` // Used when clients accessing the file system through this export diff --git a/filestorage/create_export_details.go b/filestorage/create_export_details.go index 039037336f..affdc41b6e 100644 --- a/filestorage/create_export_details.go +++ b/filestorage/create_export_details.go @@ -36,8 +36,12 @@ type CreateExportDetails struct { // { // "source" : "0.0.0.0/0", // "requirePrivilegedSourcePort" : false, - // "access" : "READ_WRITE", - // "identitySquash" : "NONE" + // "access": "READ_WRITE", + // "identitySquash": "NONE", + // "anonymousUid": 65534, + // "anonymousGid": 65534, + // "isAnonymousAccessAllowed": false, + // "allowedAuth": ["SYS"] // } // ] // **Note:** Mount targets do not have Internet-routable IP diff --git a/filestorage/create_file_system_details.go b/filestorage/create_file_system_details.go index 51187f4f71..695c433fb3 100644 --- a/filestorage/create_file_system_details.go +++ b/filestorage/create_file_system_details.go @@ -48,6 +48,11 @@ type CreateFileSystemDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the snapshot used to create a cloned file system. // See Cloning a File System (https://docs.cloud.oracle.com/iaas/Content/File/Tasks/cloningFS.htm). SourceSnapshotId *string `mandatory:"false" json:"sourceSnapshotId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated file system snapshot policy, which + // controls the frequency of snapshot creation and retention period of the taken snapshots. + // May be unset as a blank value. + FilesystemSnapshotPolicyId *string `mandatory:"false" json:"filesystemSnapshotPolicyId"` } func (m CreateFileSystemDetails) String() string { diff --git a/filestorage/create_filesystem_snapshot_policy_details.go b/filestorage/create_filesystem_snapshot_policy_details.go new file mode 100644 index 0000000000..1782b74477 --- /dev/null +++ b/filestorage/create_filesystem_snapshot_policy_details.go @@ -0,0 +1,72 @@ +// 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. + +// File Storage API +// +// Use the File Storage service API to manage file systems, mount targets, and snapshots. +// For more information, see Overview of File Storage (https://docs.cloud.oracle.com/iaas/Content/File/Concepts/filestorageoverview.htm). +// + +package filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateFilesystemSnapshotPolicyDetails Details for creating the file system snapshot policy. +type CreateFilesystemSnapshotPolicyDetails struct { + + // The availability domain that the file system snapshot policy is in. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that contains the file system snapshot policy. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + // Example: `policy1` + DisplayName *string `mandatory:"false" json:"displayName"` + + // The prefix to apply to all snapshots created by this policy. + // Example: `acme` + PolicyPrefix *string `mandatory:"false" json:"policyPrefix"` + + // The list of associated snapshot schedules. A maximum of 10 schedules can be associated with a policy. + // If using the CLI, provide the schedule as a list of JSON strings, with the list wrapped in + // quotation marks, i.e. + // ``` + // --schedules '[{"timeZone":"UTC","period":"DAILY","hourOfDay":18},{"timeZone":"UTC","period":"HOURLY"}]' + // ``` + Schedules []SnapshotSchedule `mandatory:"false" json:"schedules"` + + // 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 CreateFilesystemSnapshotPolicyDetails) 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 CreateFilesystemSnapshotPolicyDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/filestorage/create_filesystem_snapshot_policy_request_response.go b/filestorage/create_filesystem_snapshot_policy_request_response.go new file mode 100644 index 0000000000..2169f2399a --- /dev/null +++ b/filestorage/create_filesystem_snapshot_policy_request_response.go @@ -0,0 +1,102 @@ +// 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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateFilesystemSnapshotPolicyRequest wrapper for the CreateFilesystemSnapshotPolicy operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/CreateFilesystemSnapshotPolicy.go.html to see an example of how to use CreateFilesystemSnapshotPolicyRequest. +type CreateFilesystemSnapshotPolicyRequest struct { + + // Details for creating a new file system snapshot policy. + CreateFilesystemSnapshotPolicyDetails `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 + // might 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 CreateFilesystemSnapshotPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateFilesystemSnapshotPolicyRequest) 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 CreateFilesystemSnapshotPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateFilesystemSnapshotPolicyRequest) 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 CreateFilesystemSnapshotPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateFilesystemSnapshotPolicyResponse wrapper for the CreateFilesystemSnapshotPolicy operation +type CreateFilesystemSnapshotPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The FilesystemSnapshotPolicy instance + FilesystemSnapshotPolicy `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 CreateFilesystemSnapshotPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateFilesystemSnapshotPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/filestorage/create_snapshot_details.go b/filestorage/create_snapshot_details.go index bc1500720f..2b18d962b9 100644 --- a/filestorage/create_snapshot_details.go +++ b/filestorage/create_snapshot_details.go @@ -29,6 +29,9 @@ type CreateSnapshotDetails struct { // Example: `Sunday` Name *string `mandatory:"true" json:"name"` + // The time when this snapshot will be deleted. + ExpirationTime *common.SDKTime `mandatory:"false" json:"expirationTime"` + // 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). diff --git a/filestorage/delete_filesystem_snapshot_policy_request_response.go b/filestorage/delete_filesystem_snapshot_policy_request_response.go new file mode 100644 index 0000000000..2de3694343 --- /dev/null +++ b/filestorage/delete_filesystem_snapshot_policy_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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteFilesystemSnapshotPolicyRequest wrapper for the DeleteFilesystemSnapshotPolicy operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/DeleteFilesystemSnapshotPolicy.go.html to see an example of how to use DeleteFilesystemSnapshotPolicyRequest. +type DeleteFilesystemSnapshotPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy. + FilesystemSnapshotPolicyId *string `mandatory:"true" contributesTo:"path" name:"filesystemSnapshotPolicyId"` + + // 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 DeleteFilesystemSnapshotPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteFilesystemSnapshotPolicyRequest) 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 DeleteFilesystemSnapshotPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteFilesystemSnapshotPolicyRequest) 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 DeleteFilesystemSnapshotPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteFilesystemSnapshotPolicyResponse wrapper for the DeleteFilesystemSnapshotPolicy operation +type DeleteFilesystemSnapshotPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // 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 DeleteFilesystemSnapshotPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteFilesystemSnapshotPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/filestorage/file_system.go b/filestorage/file_system.go index 61a90a72f5..caa4b71d36 100644 --- a/filestorage/file_system.go +++ b/filestorage/file_system.go @@ -94,6 +94,10 @@ type FileSystem struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the replication target associated with the file system. // Empty if the file system is not being used as target in a replication. ReplicationTargetId *string `mandatory:"false" json:"replicationTargetId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated file system snapshot policy, which + // controls the frequency of snapshot creation and retention period of the taken snapshots. + FilesystemSnapshotPolicyId *string `mandatory:"false" json:"filesystemSnapshotPolicyId"` } func (m FileSystem) String() string { diff --git a/filestorage/filestorage_client.go b/filestorage/filestorage_client.go index 1bcdd88d72..ea7bf12598 100644 --- a/filestorage/filestorage_client.go +++ b/filestorage/filestorage_client.go @@ -145,6 +145,63 @@ func (client FileStorageClient) changeFileSystemCompartment(ctx context.Context, return response, err } +// ChangeFilesystemSnapshotPolicyCompartment Moves a file system snapshot policy into a different compartment within the same tenancy. For information about moving resources between compartments, see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/ChangeFilesystemSnapshotPolicyCompartment.go.html to see an example of how to use ChangeFilesystemSnapshotPolicyCompartment API. +func (client FileStorageClient) ChangeFilesystemSnapshotPolicyCompartment(ctx context.Context, request ChangeFilesystemSnapshotPolicyCompartmentRequest) (response ChangeFilesystemSnapshotPolicyCompartmentResponse, 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.changeFilesystemSnapshotPolicyCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeFilesystemSnapshotPolicyCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeFilesystemSnapshotPolicyCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeFilesystemSnapshotPolicyCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeFilesystemSnapshotPolicyCompartmentResponse") + } + return +} + +// changeFilesystemSnapshotPolicyCompartment implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) changeFilesystemSnapshotPolicyCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/filesystemSnapshotPolicies/{filesystemSnapshotPolicyId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeFilesystemSnapshotPolicyCompartmentResponse + 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/filestorage/20171215/FilesystemSnapshotPolicy/ChangeFilesystemSnapshotPolicyCompartment" + err = common.PostProcessServiceError(err, "FileStorage", "ChangeFilesystemSnapshotPolicyCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeMountTargetCompartment Moves a mount target and its associated export set into a different compartment within the same tenancy. For information about moving resources between compartments, see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes) // // See also @@ -408,6 +465,71 @@ func (client FileStorageClient) createFileSystem(ctx context.Context, request co return response, err } +// CreateFilesystemSnapshotPolicy Creates a new file system snapshot policy in the specified compartment and +// availability domain. +// After you create a file system snapshot policy, you can associate it with +// file systems. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/CreateFilesystemSnapshotPolicy.go.html to see an example of how to use CreateFilesystemSnapshotPolicy API. +func (client FileStorageClient) CreateFilesystemSnapshotPolicy(ctx context.Context, request CreateFilesystemSnapshotPolicyRequest) (response CreateFilesystemSnapshotPolicyResponse, 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.createFilesystemSnapshotPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateFilesystemSnapshotPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateFilesystemSnapshotPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateFilesystemSnapshotPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateFilesystemSnapshotPolicyResponse") + } + return +} + +// createFilesystemSnapshotPolicy implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) createFilesystemSnapshotPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/filesystemSnapshotPolicies", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateFilesystemSnapshotPolicyResponse + 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/filestorage/20171215/FilesystemSnapshotPolicy/CreateFilesystemSnapshotPolicy" + err = common.PostProcessServiceError(err, "FileStorage", "CreateFilesystemSnapshotPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateMountTarget Creates a new mount target in the specified compartment and // subnet. You can associate a file system with a mount // target only when they exist in the same availability domain. Instances @@ -761,6 +883,63 @@ func (client FileStorageClient) deleteFileSystem(ctx context.Context, request co return response, err } +// DeleteFilesystemSnapshotPolicy Deletes the specified file system snapshot policy. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/DeleteFilesystemSnapshotPolicy.go.html to see an example of how to use DeleteFilesystemSnapshotPolicy API. +func (client FileStorageClient) DeleteFilesystemSnapshotPolicy(ctx context.Context, request DeleteFilesystemSnapshotPolicyRequest) (response DeleteFilesystemSnapshotPolicyResponse, 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.deleteFilesystemSnapshotPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteFilesystemSnapshotPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteFilesystemSnapshotPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteFilesystemSnapshotPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteFilesystemSnapshotPolicyResponse") + } + return +} + +// deleteFilesystemSnapshotPolicy implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) deleteFilesystemSnapshotPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/filesystemSnapshotPolicies/{filesystemSnapshotPolicyId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteFilesystemSnapshotPolicyResponse + 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/filestorage/20171215/FilesystemSnapshotPolicy/DeleteFilesystemSnapshotPolicy" + err = common.PostProcessServiceError(err, "FileStorage", "DeleteFilesystemSnapshotPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteMountTarget Deletes the specified mount target. This operation also deletes the // mount target's VNICs. // @@ -1221,6 +1400,63 @@ func (client FileStorageClient) getFileSystem(ctx context.Context, request commo return response, err } +// GetFilesystemSnapshotPolicy Gets the specified file system snapshot policy's information. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/GetFilesystemSnapshotPolicy.go.html to see an example of how to use GetFilesystemSnapshotPolicy API. +func (client FileStorageClient) GetFilesystemSnapshotPolicy(ctx context.Context, request GetFilesystemSnapshotPolicyRequest) (response GetFilesystemSnapshotPolicyResponse, 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.getFilesystemSnapshotPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetFilesystemSnapshotPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetFilesystemSnapshotPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetFilesystemSnapshotPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetFilesystemSnapshotPolicyResponse") + } + return +} + +// getFilesystemSnapshotPolicy implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) getFilesystemSnapshotPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/filesystemSnapshotPolicies/{filesystemSnapshotPolicyId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetFilesystemSnapshotPolicyResponse + 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/filestorage/20171215/FilesystemSnapshotPolicy/GetFilesystemSnapshotPolicy" + err = common.PostProcessServiceError(err, "FileStorage", "GetFilesystemSnapshotPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetMountTarget Gets the specified mount target's information. // // See also @@ -1565,7 +1801,8 @@ func (client FileStorageClient) listExports(ctx context.Context, request common. return response, err } -// ListFileSystems Lists the file system resources in the specified compartment. +// ListFileSystems Lists the file system resources in the specified compartment, or by the specified compartment and +// file system snapshot policy. // // See also // @@ -1622,6 +1859,63 @@ func (client FileStorageClient) listFileSystems(ctx context.Context, request com return response, err } +// ListFilesystemSnapshotPolicies Lists file system snapshot policies in the specified compartment. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/ListFilesystemSnapshotPolicies.go.html to see an example of how to use ListFilesystemSnapshotPolicies API. +func (client FileStorageClient) ListFilesystemSnapshotPolicies(ctx context.Context, request ListFilesystemSnapshotPoliciesRequest) (response ListFilesystemSnapshotPoliciesResponse, 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.listFilesystemSnapshotPolicies, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListFilesystemSnapshotPoliciesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListFilesystemSnapshotPoliciesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListFilesystemSnapshotPoliciesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListFilesystemSnapshotPoliciesResponse") + } + return +} + +// listFilesystemSnapshotPolicies implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) listFilesystemSnapshotPolicies(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/filesystemSnapshotPolicies", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListFilesystemSnapshotPoliciesResponse + 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/filestorage/20171215/FilesystemSnapshotPolicySummary/ListFilesystemSnapshotPolicies" + err = common.PostProcessServiceError(err, "FileStorage", "ListFilesystemSnapshotPolicies", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListMountTargets Lists the mount target resources in the specified compartment. // // See also @@ -1793,7 +2087,9 @@ func (client FileStorageClient) listReplications(ctx context.Context, request co return response, err } -// ListSnapshots Lists snapshots of the specified file system. +// ListSnapshots Lists snapshots of the specified file system, or by file system snapshot policy and compartment, +// or by file system snapshot policy and file system. +// If file system ID is not specified, a file system snapshot policy ID and compartment ID must be specified. // // See also // @@ -1850,6 +2146,127 @@ func (client FileStorageClient) listSnapshots(ctx context.Context, request commo return response, err } +// PauseFilesystemSnapshotPolicy This operation pauses the scheduled snapshot creation and snapshot deletion of the policy and updates the lifecycle state of the file system +// snapshot policy from ACTIVE to INACTIVE. When a file system snapshot policy is paused, file systems that are associated with the +// policy will not have scheduled snapshots created or deleted. +// If the policy is already paused, or in the INACTIVE state, you cannot pause it again. You can't pause a policy +// that is in a DELETING, DELETED, FAILED, CREATING or INACTIVE state; attempts to pause a policy in these states result in a 409 conflict error. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/PauseFilesystemSnapshotPolicy.go.html to see an example of how to use PauseFilesystemSnapshotPolicy API. +func (client FileStorageClient) PauseFilesystemSnapshotPolicy(ctx context.Context, request PauseFilesystemSnapshotPolicyRequest) (response PauseFilesystemSnapshotPolicyResponse, 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.pauseFilesystemSnapshotPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PauseFilesystemSnapshotPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PauseFilesystemSnapshotPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PauseFilesystemSnapshotPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PauseFilesystemSnapshotPolicyResponse") + } + return +} + +// pauseFilesystemSnapshotPolicy implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) pauseFilesystemSnapshotPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/filesystemSnapshotPolicies/{filesystemSnapshotPolicyId}/actions/pause", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PauseFilesystemSnapshotPolicyResponse + 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/filestorage/20171215/FilesystemSnapshotPolicy/PauseFilesystemSnapshotPolicy" + err = common.PostProcessServiceError(err, "FileStorage", "PauseFilesystemSnapshotPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UnpauseFilesystemSnapshotPolicy This operation unpauses a paused file system snapshot policy and updates the lifecycle state of the file system snapshot policy from +// INACTIVE to ACTIVE. By default, file system snapshot policies are in the ACTIVE state. When a file system snapshot policy is not paused, or in the ACTIVE state, file systems that are associated with the +// policy will have snapshots created and deleted according to the schedules defined in the policy. +// If the policy is already in the ACTIVE state, you cannot unpause it. You can't unpause a policy that is in a DELETING, DELETED, FAILED, CREATING, or ACTIVE state; attempts to unpause a policy in these states result in a 409 conflict error. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/UnpauseFilesystemSnapshotPolicy.go.html to see an example of how to use UnpauseFilesystemSnapshotPolicy API. +func (client FileStorageClient) UnpauseFilesystemSnapshotPolicy(ctx context.Context, request UnpauseFilesystemSnapshotPolicyRequest) (response UnpauseFilesystemSnapshotPolicyResponse, 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.unpauseFilesystemSnapshotPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UnpauseFilesystemSnapshotPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UnpauseFilesystemSnapshotPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UnpauseFilesystemSnapshotPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UnpauseFilesystemSnapshotPolicyResponse") + } + return +} + +// unpauseFilesystemSnapshotPolicy implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) unpauseFilesystemSnapshotPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/filesystemSnapshotPolicies/{filesystemSnapshotPolicyId}/actions/unpause", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UnpauseFilesystemSnapshotPolicyResponse + 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/filestorage/20171215/FilesystemSnapshotPolicy/UnpauseFilesystemSnapshotPolicy" + err = common.PostProcessServiceError(err, "FileStorage", "UnpauseFilesystemSnapshotPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateExport Updates the specified export's information. // // See also @@ -2022,6 +2439,63 @@ func (client FileStorageClient) updateFileSystem(ctx context.Context, request co return response, err } +// UpdateFilesystemSnapshotPolicy Updates the specified file system snapshot policy's information. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/UpdateFilesystemSnapshotPolicy.go.html to see an example of how to use UpdateFilesystemSnapshotPolicy API. +func (client FileStorageClient) UpdateFilesystemSnapshotPolicy(ctx context.Context, request UpdateFilesystemSnapshotPolicyRequest) (response UpdateFilesystemSnapshotPolicyResponse, 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.updateFilesystemSnapshotPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateFilesystemSnapshotPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateFilesystemSnapshotPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateFilesystemSnapshotPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateFilesystemSnapshotPolicyResponse") + } + return +} + +// updateFilesystemSnapshotPolicy implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) updateFilesystemSnapshotPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/filesystemSnapshotPolicies/{filesystemSnapshotPolicyId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateFilesystemSnapshotPolicyResponse + 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/filestorage/20171215/FilesystemSnapshotPolicy/UpdateFilesystemSnapshotPolicy" + err = common.PostProcessServiceError(err, "FileStorage", "UpdateFilesystemSnapshotPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateMountTarget Updates the specified mount target's information. // // See also diff --git a/filestorage/filesystem_snapshot_policy.go b/filestorage/filesystem_snapshot_policy.go new file mode 100644 index 0000000000..f410becf0a --- /dev/null +++ b/filestorage/filesystem_snapshot_policy.go @@ -0,0 +1,143 @@ +// 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. + +// File Storage API +// +// Use the File Storage service API to manage file systems, mount targets, and snapshots. +// For more information, see Overview of File Storage (https://docs.cloud.oracle.com/iaas/Content/File/Concepts/filestorageoverview.htm). +// + +package filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FilesystemSnapshotPolicy A file system snapshot policy is used to automate snapshot creation and deletion. +// It contains a list of snapshot schedules that define the frequency of +// snapshot creation for the associated file systems and the retention period of snapshots taken on schedule. +// For more information, see Snapshot Scheduling (https://docs.cloud.oracle.com/iaas/Content/File/Tasks/snapshot-policies-and-schedules.htm). +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies (https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm). +type FilesystemSnapshotPolicy struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that contains the file system snapshot policy. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The availability domain that the file system snapshot policy is in. May be unset using a blank or NULL value. + // Example: `Uocm:PHX-AD-2` + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy. + Id *string `mandatory:"true" json:"id"` + + // The current state of the file system snapshot policy. + LifecycleState FilesystemSnapshotPolicyLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the file system snapshot policy was created, expressed + // in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) timestamp format. + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // A user-friendly name. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + // Example: `policy1` + DisplayName *string `mandatory:"false" json:"displayName"` + + // The prefix to apply to all snapshots created by this policy. + // Example: `acme` + PolicyPrefix *string `mandatory:"false" json:"policyPrefix"` + + // The list of associated snapshot schedules. A maximum of 10 schedules can be associated with a policy. + Schedules []SnapshotSchedule `mandatory:"false" json:"schedules"` + + // 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 FilesystemSnapshotPolicy) 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 FilesystemSnapshotPolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingFilesystemSnapshotPolicyLifecycleStateEnum(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(GetFilesystemSnapshotPolicyLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// FilesystemSnapshotPolicyLifecycleStateEnum Enum with underlying type: string +type FilesystemSnapshotPolicyLifecycleStateEnum string + +// Set of constants representing the allowable values for FilesystemSnapshotPolicyLifecycleStateEnum +const ( + FilesystemSnapshotPolicyLifecycleStateCreating FilesystemSnapshotPolicyLifecycleStateEnum = "CREATING" + FilesystemSnapshotPolicyLifecycleStateActive FilesystemSnapshotPolicyLifecycleStateEnum = "ACTIVE" + FilesystemSnapshotPolicyLifecycleStateDeleting FilesystemSnapshotPolicyLifecycleStateEnum = "DELETING" + FilesystemSnapshotPolicyLifecycleStateDeleted FilesystemSnapshotPolicyLifecycleStateEnum = "DELETED" + FilesystemSnapshotPolicyLifecycleStateInactive FilesystemSnapshotPolicyLifecycleStateEnum = "INACTIVE" + FilesystemSnapshotPolicyLifecycleStateFailed FilesystemSnapshotPolicyLifecycleStateEnum = "FAILED" +) + +var mappingFilesystemSnapshotPolicyLifecycleStateEnum = map[string]FilesystemSnapshotPolicyLifecycleStateEnum{ + "CREATING": FilesystemSnapshotPolicyLifecycleStateCreating, + "ACTIVE": FilesystemSnapshotPolicyLifecycleStateActive, + "DELETING": FilesystemSnapshotPolicyLifecycleStateDeleting, + "DELETED": FilesystemSnapshotPolicyLifecycleStateDeleted, + "INACTIVE": FilesystemSnapshotPolicyLifecycleStateInactive, + "FAILED": FilesystemSnapshotPolicyLifecycleStateFailed, +} + +var mappingFilesystemSnapshotPolicyLifecycleStateEnumLowerCase = map[string]FilesystemSnapshotPolicyLifecycleStateEnum{ + "creating": FilesystemSnapshotPolicyLifecycleStateCreating, + "active": FilesystemSnapshotPolicyLifecycleStateActive, + "deleting": FilesystemSnapshotPolicyLifecycleStateDeleting, + "deleted": FilesystemSnapshotPolicyLifecycleStateDeleted, + "inactive": FilesystemSnapshotPolicyLifecycleStateInactive, + "failed": FilesystemSnapshotPolicyLifecycleStateFailed, +} + +// GetFilesystemSnapshotPolicyLifecycleStateEnumValues Enumerates the set of values for FilesystemSnapshotPolicyLifecycleStateEnum +func GetFilesystemSnapshotPolicyLifecycleStateEnumValues() []FilesystemSnapshotPolicyLifecycleStateEnum { + values := make([]FilesystemSnapshotPolicyLifecycleStateEnum, 0) + for _, v := range mappingFilesystemSnapshotPolicyLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetFilesystemSnapshotPolicyLifecycleStateEnumStringValues Enumerates the set of values in String for FilesystemSnapshotPolicyLifecycleStateEnum +func GetFilesystemSnapshotPolicyLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "DELETING", + "DELETED", + "INACTIVE", + "FAILED", + } +} + +// GetMappingFilesystemSnapshotPolicyLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingFilesystemSnapshotPolicyLifecycleStateEnum(val string) (FilesystemSnapshotPolicyLifecycleStateEnum, bool) { + enum, ok := mappingFilesystemSnapshotPolicyLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/filestorage/filesystem_snapshot_policy_summary.go b/filestorage/filesystem_snapshot_policy_summary.go new file mode 100644 index 0000000000..d3a7bd8b91 --- /dev/null +++ b/filestorage/filesystem_snapshot_policy_summary.go @@ -0,0 +1,136 @@ +// 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. + +// File Storage API +// +// Use the File Storage service API to manage file systems, mount targets, and snapshots. +// For more information, see Overview of File Storage (https://docs.cloud.oracle.com/iaas/Content/File/Concepts/filestorageoverview.htm). +// + +package filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FilesystemSnapshotPolicySummary Summary information for a file system snapshot policy. +type FilesystemSnapshotPolicySummary struct { + + // The availability domain that the file system snapshot policy is in. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that contains the file system snapshot policy. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy. + Id *string `mandatory:"true" json:"id"` + + // The current state of this file system snapshot policy. + LifecycleState FilesystemSnapshotPolicySummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time that the file system snapshot policy was created + // in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) timestamp format. + // Example: `2020-02-04T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // A user-friendly name. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + // Example: `My Filesystem Snapshot Policy` + DisplayName *string `mandatory:"false" json:"displayName"` + + // The prefix to apply to all snapshots created by this policy. + // Example: `acme` + PolicyPrefix *string `mandatory:"false" json:"policyPrefix"` + + // 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 FilesystemSnapshotPolicySummary) 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 FilesystemSnapshotPolicySummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingFilesystemSnapshotPolicySummaryLifecycleStateEnum(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(GetFilesystemSnapshotPolicySummaryLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// FilesystemSnapshotPolicySummaryLifecycleStateEnum Enum with underlying type: string +type FilesystemSnapshotPolicySummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for FilesystemSnapshotPolicySummaryLifecycleStateEnum +const ( + FilesystemSnapshotPolicySummaryLifecycleStateCreating FilesystemSnapshotPolicySummaryLifecycleStateEnum = "CREATING" + FilesystemSnapshotPolicySummaryLifecycleStateActive FilesystemSnapshotPolicySummaryLifecycleStateEnum = "ACTIVE" + FilesystemSnapshotPolicySummaryLifecycleStateDeleting FilesystemSnapshotPolicySummaryLifecycleStateEnum = "DELETING" + FilesystemSnapshotPolicySummaryLifecycleStateDeleted FilesystemSnapshotPolicySummaryLifecycleStateEnum = "DELETED" + FilesystemSnapshotPolicySummaryLifecycleStateInactive FilesystemSnapshotPolicySummaryLifecycleStateEnum = "INACTIVE" + FilesystemSnapshotPolicySummaryLifecycleStateFailed FilesystemSnapshotPolicySummaryLifecycleStateEnum = "FAILED" +) + +var mappingFilesystemSnapshotPolicySummaryLifecycleStateEnum = map[string]FilesystemSnapshotPolicySummaryLifecycleStateEnum{ + "CREATING": FilesystemSnapshotPolicySummaryLifecycleStateCreating, + "ACTIVE": FilesystemSnapshotPolicySummaryLifecycleStateActive, + "DELETING": FilesystemSnapshotPolicySummaryLifecycleStateDeleting, + "DELETED": FilesystemSnapshotPolicySummaryLifecycleStateDeleted, + "INACTIVE": FilesystemSnapshotPolicySummaryLifecycleStateInactive, + "FAILED": FilesystemSnapshotPolicySummaryLifecycleStateFailed, +} + +var mappingFilesystemSnapshotPolicySummaryLifecycleStateEnumLowerCase = map[string]FilesystemSnapshotPolicySummaryLifecycleStateEnum{ + "creating": FilesystemSnapshotPolicySummaryLifecycleStateCreating, + "active": FilesystemSnapshotPolicySummaryLifecycleStateActive, + "deleting": FilesystemSnapshotPolicySummaryLifecycleStateDeleting, + "deleted": FilesystemSnapshotPolicySummaryLifecycleStateDeleted, + "inactive": FilesystemSnapshotPolicySummaryLifecycleStateInactive, + "failed": FilesystemSnapshotPolicySummaryLifecycleStateFailed, +} + +// GetFilesystemSnapshotPolicySummaryLifecycleStateEnumValues Enumerates the set of values for FilesystemSnapshotPolicySummaryLifecycleStateEnum +func GetFilesystemSnapshotPolicySummaryLifecycleStateEnumValues() []FilesystemSnapshotPolicySummaryLifecycleStateEnum { + values := make([]FilesystemSnapshotPolicySummaryLifecycleStateEnum, 0) + for _, v := range mappingFilesystemSnapshotPolicySummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetFilesystemSnapshotPolicySummaryLifecycleStateEnumStringValues Enumerates the set of values in String for FilesystemSnapshotPolicySummaryLifecycleStateEnum +func GetFilesystemSnapshotPolicySummaryLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "DELETING", + "DELETED", + "INACTIVE", + "FAILED", + } +} + +// GetMappingFilesystemSnapshotPolicySummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingFilesystemSnapshotPolicySummaryLifecycleStateEnum(val string) (FilesystemSnapshotPolicySummaryLifecycleStateEnum, bool) { + enum, ok := mappingFilesystemSnapshotPolicySummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/filestorage/get_filesystem_snapshot_policy_request_response.go b/filestorage/get_filesystem_snapshot_policy_request_response.go new file mode 100644 index 0000000000..44f9bfc736 --- /dev/null +++ b/filestorage/get_filesystem_snapshot_policy_request_response.go @@ -0,0 +1,95 @@ +// 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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetFilesystemSnapshotPolicyRequest wrapper for the GetFilesystemSnapshotPolicy operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/GetFilesystemSnapshotPolicy.go.html to see an example of how to use GetFilesystemSnapshotPolicyRequest. +type GetFilesystemSnapshotPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy. + FilesystemSnapshotPolicyId *string `mandatory:"true" contributesTo:"path" name:"filesystemSnapshotPolicyId"` + + // 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 GetFilesystemSnapshotPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetFilesystemSnapshotPolicyRequest) 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 GetFilesystemSnapshotPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetFilesystemSnapshotPolicyRequest) 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 GetFilesystemSnapshotPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetFilesystemSnapshotPolicyResponse wrapper for the GetFilesystemSnapshotPolicy operation +type GetFilesystemSnapshotPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The FilesystemSnapshotPolicy instance + FilesystemSnapshotPolicy `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 GetFilesystemSnapshotPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetFilesystemSnapshotPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/filestorage/list_file_systems_request_response.go b/filestorage/list_file_systems_request_response.go index dd919e934c..5a18c88ac2 100644 --- a/filestorage/list_file_systems_request_response.go +++ b/filestorage/list_file_systems_request_response.go @@ -57,6 +57,10 @@ type ListFileSystemsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system that contains the source snapshot of a cloned file system. See Cloning a File System (https://docs.cloud.oracle.com/iaas/Content/File/Tasks/cloningFS.htm). ParentFileSystemId *string `mandatory:"false" contributesTo:"query" name:"parentFileSystemId"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy + // that is associated with the file systems. + FilesystemSnapshotPolicyId *string `mandatory:"false" contributesTo:"query" name:"filesystemSnapshotPolicyId"` + // The field to sort by. You can provide either value, but not both. // By default, when you sort by time created, results are shown // in descending order. When you sort by display name, results are diff --git a/filestorage/list_filesystem_snapshot_policies_request_response.go b/filestorage/list_filesystem_snapshot_policies_request_response.go new file mode 100644 index 0000000000..ae69de15bc --- /dev/null +++ b/filestorage/list_filesystem_snapshot_policies_request_response.go @@ -0,0 +1,290 @@ +// 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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListFilesystemSnapshotPoliciesRequest wrapper for the ListFilesystemSnapshotPolicies operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/ListFilesystemSnapshotPolicies.go.html to see an example of how to use ListFilesystemSnapshotPoliciesRequest. +type ListFilesystemSnapshotPoliciesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The name of the availability domain. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"true" contributesTo:"query" name:"availabilityDomain"` + + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + // Example: `500` + 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"` + + // A user-friendly name. It does not have to be unique, and it is changeable. + // Example: `My resource` + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Filter results by the specified lifecycle state. Must be a valid + // state for the resource type. + LifecycleState ListFilesystemSnapshotPoliciesLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Filter results by OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). Must be an OCID of the correct type for + // the resouce type. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // The field to sort by. You can provide either value, but not both. + // By default, when you sort by time created, results are shown + // in descending order. When you sort by displayName, results are + // shown in ascending alphanumeric order. + SortBy ListFilesystemSnapshotPoliciesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'asc' or 'desc', where 'asc' is + // ascending and 'desc' is descending. The default order is 'desc' + // except for numeric values. + SortOrder ListFilesystemSnapshotPoliciesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" 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"` + + // 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 ListFilesystemSnapshotPoliciesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListFilesystemSnapshotPoliciesRequest) 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 ListFilesystemSnapshotPoliciesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListFilesystemSnapshotPoliciesRequest) 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 ListFilesystemSnapshotPoliciesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListFilesystemSnapshotPoliciesLifecycleStateEnum(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(GetListFilesystemSnapshotPoliciesLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListFilesystemSnapshotPoliciesSortByEnum(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(GetListFilesystemSnapshotPoliciesSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListFilesystemSnapshotPoliciesSortOrderEnum(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(GetListFilesystemSnapshotPoliciesSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListFilesystemSnapshotPoliciesResponse wrapper for the ListFilesystemSnapshotPolicies operation +type ListFilesystemSnapshotPoliciesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []FilesystemSnapshotPolicySummary instances + Items []FilesystemSnapshotPolicySummary `presentIn:"body"` + + // 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"` + + // 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 ListFilesystemSnapshotPoliciesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListFilesystemSnapshotPoliciesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListFilesystemSnapshotPoliciesLifecycleStateEnum Enum with underlying type: string +type ListFilesystemSnapshotPoliciesLifecycleStateEnum string + +// Set of constants representing the allowable values for ListFilesystemSnapshotPoliciesLifecycleStateEnum +const ( + ListFilesystemSnapshotPoliciesLifecycleStateCreating ListFilesystemSnapshotPoliciesLifecycleStateEnum = "CREATING" + ListFilesystemSnapshotPoliciesLifecycleStateActive ListFilesystemSnapshotPoliciesLifecycleStateEnum = "ACTIVE" + ListFilesystemSnapshotPoliciesLifecycleStateDeleting ListFilesystemSnapshotPoliciesLifecycleStateEnum = "DELETING" + ListFilesystemSnapshotPoliciesLifecycleStateDeleted ListFilesystemSnapshotPoliciesLifecycleStateEnum = "DELETED" + ListFilesystemSnapshotPoliciesLifecycleStateFailed ListFilesystemSnapshotPoliciesLifecycleStateEnum = "FAILED" + ListFilesystemSnapshotPoliciesLifecycleStateInactive ListFilesystemSnapshotPoliciesLifecycleStateEnum = "INACTIVE" +) + +var mappingListFilesystemSnapshotPoliciesLifecycleStateEnum = map[string]ListFilesystemSnapshotPoliciesLifecycleStateEnum{ + "CREATING": ListFilesystemSnapshotPoliciesLifecycleStateCreating, + "ACTIVE": ListFilesystemSnapshotPoliciesLifecycleStateActive, + "DELETING": ListFilesystemSnapshotPoliciesLifecycleStateDeleting, + "DELETED": ListFilesystemSnapshotPoliciesLifecycleStateDeleted, + "FAILED": ListFilesystemSnapshotPoliciesLifecycleStateFailed, + "INACTIVE": ListFilesystemSnapshotPoliciesLifecycleStateInactive, +} + +var mappingListFilesystemSnapshotPoliciesLifecycleStateEnumLowerCase = map[string]ListFilesystemSnapshotPoliciesLifecycleStateEnum{ + "creating": ListFilesystemSnapshotPoliciesLifecycleStateCreating, + "active": ListFilesystemSnapshotPoliciesLifecycleStateActive, + "deleting": ListFilesystemSnapshotPoliciesLifecycleStateDeleting, + "deleted": ListFilesystemSnapshotPoliciesLifecycleStateDeleted, + "failed": ListFilesystemSnapshotPoliciesLifecycleStateFailed, + "inactive": ListFilesystemSnapshotPoliciesLifecycleStateInactive, +} + +// GetListFilesystemSnapshotPoliciesLifecycleStateEnumValues Enumerates the set of values for ListFilesystemSnapshotPoliciesLifecycleStateEnum +func GetListFilesystemSnapshotPoliciesLifecycleStateEnumValues() []ListFilesystemSnapshotPoliciesLifecycleStateEnum { + values := make([]ListFilesystemSnapshotPoliciesLifecycleStateEnum, 0) + for _, v := range mappingListFilesystemSnapshotPoliciesLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListFilesystemSnapshotPoliciesLifecycleStateEnumStringValues Enumerates the set of values in String for ListFilesystemSnapshotPoliciesLifecycleStateEnum +func GetListFilesystemSnapshotPoliciesLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + "INACTIVE", + } +} + +// GetMappingListFilesystemSnapshotPoliciesLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListFilesystemSnapshotPoliciesLifecycleStateEnum(val string) (ListFilesystemSnapshotPoliciesLifecycleStateEnum, bool) { + enum, ok := mappingListFilesystemSnapshotPoliciesLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListFilesystemSnapshotPoliciesSortByEnum Enum with underlying type: string +type ListFilesystemSnapshotPoliciesSortByEnum string + +// Set of constants representing the allowable values for ListFilesystemSnapshotPoliciesSortByEnum +const ( + ListFilesystemSnapshotPoliciesSortByTimecreated ListFilesystemSnapshotPoliciesSortByEnum = "TIMECREATED" + ListFilesystemSnapshotPoliciesSortByDisplayname ListFilesystemSnapshotPoliciesSortByEnum = "DISPLAYNAME" +) + +var mappingListFilesystemSnapshotPoliciesSortByEnum = map[string]ListFilesystemSnapshotPoliciesSortByEnum{ + "TIMECREATED": ListFilesystemSnapshotPoliciesSortByTimecreated, + "DISPLAYNAME": ListFilesystemSnapshotPoliciesSortByDisplayname, +} + +var mappingListFilesystemSnapshotPoliciesSortByEnumLowerCase = map[string]ListFilesystemSnapshotPoliciesSortByEnum{ + "timecreated": ListFilesystemSnapshotPoliciesSortByTimecreated, + "displayname": ListFilesystemSnapshotPoliciesSortByDisplayname, +} + +// GetListFilesystemSnapshotPoliciesSortByEnumValues Enumerates the set of values for ListFilesystemSnapshotPoliciesSortByEnum +func GetListFilesystemSnapshotPoliciesSortByEnumValues() []ListFilesystemSnapshotPoliciesSortByEnum { + values := make([]ListFilesystemSnapshotPoliciesSortByEnum, 0) + for _, v := range mappingListFilesystemSnapshotPoliciesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListFilesystemSnapshotPoliciesSortByEnumStringValues Enumerates the set of values in String for ListFilesystemSnapshotPoliciesSortByEnum +func GetListFilesystemSnapshotPoliciesSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListFilesystemSnapshotPoliciesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListFilesystemSnapshotPoliciesSortByEnum(val string) (ListFilesystemSnapshotPoliciesSortByEnum, bool) { + enum, ok := mappingListFilesystemSnapshotPoliciesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListFilesystemSnapshotPoliciesSortOrderEnum Enum with underlying type: string +type ListFilesystemSnapshotPoliciesSortOrderEnum string + +// Set of constants representing the allowable values for ListFilesystemSnapshotPoliciesSortOrderEnum +const ( + ListFilesystemSnapshotPoliciesSortOrderAsc ListFilesystemSnapshotPoliciesSortOrderEnum = "ASC" + ListFilesystemSnapshotPoliciesSortOrderDesc ListFilesystemSnapshotPoliciesSortOrderEnum = "DESC" +) + +var mappingListFilesystemSnapshotPoliciesSortOrderEnum = map[string]ListFilesystemSnapshotPoliciesSortOrderEnum{ + "ASC": ListFilesystemSnapshotPoliciesSortOrderAsc, + "DESC": ListFilesystemSnapshotPoliciesSortOrderDesc, +} + +var mappingListFilesystemSnapshotPoliciesSortOrderEnumLowerCase = map[string]ListFilesystemSnapshotPoliciesSortOrderEnum{ + "asc": ListFilesystemSnapshotPoliciesSortOrderAsc, + "desc": ListFilesystemSnapshotPoliciesSortOrderDesc, +} + +// GetListFilesystemSnapshotPoliciesSortOrderEnumValues Enumerates the set of values for ListFilesystemSnapshotPoliciesSortOrderEnum +func GetListFilesystemSnapshotPoliciesSortOrderEnumValues() []ListFilesystemSnapshotPoliciesSortOrderEnum { + values := make([]ListFilesystemSnapshotPoliciesSortOrderEnum, 0) + for _, v := range mappingListFilesystemSnapshotPoliciesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListFilesystemSnapshotPoliciesSortOrderEnumStringValues Enumerates the set of values in String for ListFilesystemSnapshotPoliciesSortOrderEnum +func GetListFilesystemSnapshotPoliciesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListFilesystemSnapshotPoliciesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListFilesystemSnapshotPoliciesSortOrderEnum(val string) (ListFilesystemSnapshotPoliciesSortOrderEnum, bool) { + enum, ok := mappingListFilesystemSnapshotPoliciesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/filestorage/list_snapshots_request_response.go b/filestorage/list_snapshots_request_response.go index 23e58b2efb..0475acc900 100644 --- a/filestorage/list_snapshots_request_response.go +++ b/filestorage/list_snapshots_request_response.go @@ -18,9 +18,6 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/ListSnapshots.go.html to see an example of how to use ListSnapshotsRequest. type ListSnapshotsRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system. - FileSystemId *string `mandatory:"true" contributesTo:"query" name:"fileSystemId"` - // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. // 1 is the minimum, 100 is the maximum. @@ -43,6 +40,16 @@ type ListSnapshotsRequest struct { // the resouce type. Id *string `mandatory:"false" contributesTo:"query" name:"id"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy + // that is used to create the snapshots. + FilesystemSnapshotPolicyId *string `mandatory:"false" contributesTo:"query" name:"filesystemSnapshotPolicyId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system. + FileSystemId *string `mandatory:"false" contributesTo:"query" name:"fileSystemId"` + // The sort order to use, either 'asc' or 'desc', where 'asc' is // ascending and 'desc' is descending. The default order is 'desc' // except for numeric values. diff --git a/filestorage/pause_filesystem_snapshot_policy_request_response.go b/filestorage/pause_filesystem_snapshot_policy_request_response.go new file mode 100644 index 0000000000..c640ccd2c9 --- /dev/null +++ b/filestorage/pause_filesystem_snapshot_policy_request_response.go @@ -0,0 +1,102 @@ +// 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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PauseFilesystemSnapshotPolicyRequest wrapper for the PauseFilesystemSnapshotPolicy operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/PauseFilesystemSnapshotPolicy.go.html to see an example of how to use PauseFilesystemSnapshotPolicyRequest. +type PauseFilesystemSnapshotPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy. + FilesystemSnapshotPolicyId *string `mandatory:"true" contributesTo:"path" name:"filesystemSnapshotPolicyId"` + + // 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 PauseFilesystemSnapshotPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PauseFilesystemSnapshotPolicyRequest) 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 PauseFilesystemSnapshotPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PauseFilesystemSnapshotPolicyRequest) 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 PauseFilesystemSnapshotPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PauseFilesystemSnapshotPolicyResponse wrapper for the PauseFilesystemSnapshotPolicy operation +type PauseFilesystemSnapshotPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The FilesystemSnapshotPolicy instance + FilesystemSnapshotPolicy `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 PauseFilesystemSnapshotPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PauseFilesystemSnapshotPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/filestorage/snapshot.go b/filestorage/snapshot.go index edf48e0817..2cb3233229 100644 --- a/filestorage/snapshot.go +++ b/filestorage/snapshot.go @@ -75,6 +75,12 @@ type Snapshot struct { // 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"` + + // The time when this snapshot will be deleted. + ExpirationTime *common.SDKTime `mandatory:"false" json:"expirationTime"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy that created this snapshot. + FilesystemSnapshotPolicyId *string `mandatory:"false" json:"filesystemSnapshotPolicyId"` } func (m Snapshot) String() string { diff --git a/filestorage/snapshot_schedule.go b/filestorage/snapshot_schedule.go new file mode 100644 index 0000000000..c6096d6767 --- /dev/null +++ b/filestorage/snapshot_schedule.go @@ -0,0 +1,326 @@ +// 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. + +// File Storage API +// +// Use the File Storage service API to manage file systems, mount targets, and snapshots. +// For more information, see Overview of File Storage (https://docs.cloud.oracle.com/iaas/Content/File/Concepts/filestorageoverview.htm). +// + +package filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SnapshotSchedule The snapshot schedule is a structure within a parent file system snapshot policy. It contains data about +// the frequency of snapshot creation and the retention time of the taken snapshots. +type SnapshotSchedule struct { + + // The frequency of scheduled snapshots. + Period SnapshotSchedulePeriodEnum `mandatory:"true" json:"period"` + + // Time zone used for scheduling the snapshot. + TimeZone SnapshotScheduleTimeZoneEnum `mandatory:"true" json:"timeZone"` + + // A name prefix to be applied to snapshots created by this schedule. + // Example: `compliance1` + SchedulePrefix *string `mandatory:"false" json:"schedulePrefix"` + + // The starting point used to begin the scheduling of the snapshots based upon recurrence string + // in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) timestamp format. + // If no `timeScheduleStart` is provided, the value will be set to the time when the schedule was created. + TimeScheduleStart *common.SDKTime `mandatory:"false" json:"timeScheduleStart"` + + // The number of seconds to retain snapshots created with this schedule. + // Snapshot expiration time will not be set if this value is empty. + RetentionDurationInSeconds *int64 `mandatory:"false" json:"retentionDurationInSeconds"` + + // The hour of the day to create a DAILY, WEEKLY, MONTHLY, or YEARLY snapshot. + // If not set, a value will be chosen at creation time. + HourOfDay *int `mandatory:"false" json:"hourOfDay"` + + // The day of the week to create a scheduled snapshot. + // Used for WEEKLY snapshot schedules. + DayOfWeek SnapshotScheduleDayOfWeekEnum `mandatory:"false" json:"dayOfWeek,omitempty"` + + // The day of the month to create a scheduled snapshot. + // If the day does not exist for the month, snapshot creation will be skipped. + // Used for MONTHLY and YEARLY snapshot schedules. + DayOfMonth *int `mandatory:"false" json:"dayOfMonth"` + + // The month to create a scheduled snapshot. + // Used only for YEARLY snapshot schedules. + Month SnapshotScheduleMonthEnum `mandatory:"false" json:"month,omitempty"` +} + +func (m SnapshotSchedule) 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 SnapshotSchedule) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSnapshotSchedulePeriodEnum(string(m.Period)); !ok && m.Period != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Period: %s. Supported values are: %s.", m.Period, strings.Join(GetSnapshotSchedulePeriodEnumStringValues(), ","))) + } + if _, ok := GetMappingSnapshotScheduleTimeZoneEnum(string(m.TimeZone)); !ok && m.TimeZone != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for TimeZone: %s. Supported values are: %s.", m.TimeZone, strings.Join(GetSnapshotScheduleTimeZoneEnumStringValues(), ","))) + } + + if _, ok := GetMappingSnapshotScheduleDayOfWeekEnum(string(m.DayOfWeek)); !ok && m.DayOfWeek != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DayOfWeek: %s. Supported values are: %s.", m.DayOfWeek, strings.Join(GetSnapshotScheduleDayOfWeekEnumStringValues(), ","))) + } + if _, ok := GetMappingSnapshotScheduleMonthEnum(string(m.Month)); !ok && m.Month != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Month: %s. Supported values are: %s.", m.Month, strings.Join(GetSnapshotScheduleMonthEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SnapshotSchedulePeriodEnum Enum with underlying type: string +type SnapshotSchedulePeriodEnum string + +// Set of constants representing the allowable values for SnapshotSchedulePeriodEnum +const ( + SnapshotSchedulePeriodHourly SnapshotSchedulePeriodEnum = "HOURLY" + SnapshotSchedulePeriodDaily SnapshotSchedulePeriodEnum = "DAILY" + SnapshotSchedulePeriodWeekly SnapshotSchedulePeriodEnum = "WEEKLY" + SnapshotSchedulePeriodMonthly SnapshotSchedulePeriodEnum = "MONTHLY" + SnapshotSchedulePeriodYearly SnapshotSchedulePeriodEnum = "YEARLY" +) + +var mappingSnapshotSchedulePeriodEnum = map[string]SnapshotSchedulePeriodEnum{ + "HOURLY": SnapshotSchedulePeriodHourly, + "DAILY": SnapshotSchedulePeriodDaily, + "WEEKLY": SnapshotSchedulePeriodWeekly, + "MONTHLY": SnapshotSchedulePeriodMonthly, + "YEARLY": SnapshotSchedulePeriodYearly, +} + +var mappingSnapshotSchedulePeriodEnumLowerCase = map[string]SnapshotSchedulePeriodEnum{ + "hourly": SnapshotSchedulePeriodHourly, + "daily": SnapshotSchedulePeriodDaily, + "weekly": SnapshotSchedulePeriodWeekly, + "monthly": SnapshotSchedulePeriodMonthly, + "yearly": SnapshotSchedulePeriodYearly, +} + +// GetSnapshotSchedulePeriodEnumValues Enumerates the set of values for SnapshotSchedulePeriodEnum +func GetSnapshotSchedulePeriodEnumValues() []SnapshotSchedulePeriodEnum { + values := make([]SnapshotSchedulePeriodEnum, 0) + for _, v := range mappingSnapshotSchedulePeriodEnum { + values = append(values, v) + } + return values +} + +// GetSnapshotSchedulePeriodEnumStringValues Enumerates the set of values in String for SnapshotSchedulePeriodEnum +func GetSnapshotSchedulePeriodEnumStringValues() []string { + return []string{ + "HOURLY", + "DAILY", + "WEEKLY", + "MONTHLY", + "YEARLY", + } +} + +// GetMappingSnapshotSchedulePeriodEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSnapshotSchedulePeriodEnum(val string) (SnapshotSchedulePeriodEnum, bool) { + enum, ok := mappingSnapshotSchedulePeriodEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SnapshotScheduleTimeZoneEnum Enum with underlying type: string +type SnapshotScheduleTimeZoneEnum string + +// Set of constants representing the allowable values for SnapshotScheduleTimeZoneEnum +const ( + SnapshotScheduleTimeZoneUtc SnapshotScheduleTimeZoneEnum = "UTC" + SnapshotScheduleTimeZoneRegionalDataCenterTime SnapshotScheduleTimeZoneEnum = "REGIONAL_DATA_CENTER_TIME" +) + +var mappingSnapshotScheduleTimeZoneEnum = map[string]SnapshotScheduleTimeZoneEnum{ + "UTC": SnapshotScheduleTimeZoneUtc, + "REGIONAL_DATA_CENTER_TIME": SnapshotScheduleTimeZoneRegionalDataCenterTime, +} + +var mappingSnapshotScheduleTimeZoneEnumLowerCase = map[string]SnapshotScheduleTimeZoneEnum{ + "utc": SnapshotScheduleTimeZoneUtc, + "regional_data_center_time": SnapshotScheduleTimeZoneRegionalDataCenterTime, +} + +// GetSnapshotScheduleTimeZoneEnumValues Enumerates the set of values for SnapshotScheduleTimeZoneEnum +func GetSnapshotScheduleTimeZoneEnumValues() []SnapshotScheduleTimeZoneEnum { + values := make([]SnapshotScheduleTimeZoneEnum, 0) + for _, v := range mappingSnapshotScheduleTimeZoneEnum { + values = append(values, v) + } + return values +} + +// GetSnapshotScheduleTimeZoneEnumStringValues Enumerates the set of values in String for SnapshotScheduleTimeZoneEnum +func GetSnapshotScheduleTimeZoneEnumStringValues() []string { + return []string{ + "UTC", + "REGIONAL_DATA_CENTER_TIME", + } +} + +// GetMappingSnapshotScheduleTimeZoneEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSnapshotScheduleTimeZoneEnum(val string) (SnapshotScheduleTimeZoneEnum, bool) { + enum, ok := mappingSnapshotScheduleTimeZoneEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SnapshotScheduleDayOfWeekEnum Enum with underlying type: string +type SnapshotScheduleDayOfWeekEnum string + +// Set of constants representing the allowable values for SnapshotScheduleDayOfWeekEnum +const ( + SnapshotScheduleDayOfWeekMonday SnapshotScheduleDayOfWeekEnum = "MONDAY" + SnapshotScheduleDayOfWeekTuesday SnapshotScheduleDayOfWeekEnum = "TUESDAY" + SnapshotScheduleDayOfWeekWednesday SnapshotScheduleDayOfWeekEnum = "WEDNESDAY" + SnapshotScheduleDayOfWeekThursday SnapshotScheduleDayOfWeekEnum = "THURSDAY" + SnapshotScheduleDayOfWeekFriday SnapshotScheduleDayOfWeekEnum = "FRIDAY" + SnapshotScheduleDayOfWeekSaturday SnapshotScheduleDayOfWeekEnum = "SATURDAY" + SnapshotScheduleDayOfWeekSunday SnapshotScheduleDayOfWeekEnum = "SUNDAY" +) + +var mappingSnapshotScheduleDayOfWeekEnum = map[string]SnapshotScheduleDayOfWeekEnum{ + "MONDAY": SnapshotScheduleDayOfWeekMonday, + "TUESDAY": SnapshotScheduleDayOfWeekTuesday, + "WEDNESDAY": SnapshotScheduleDayOfWeekWednesday, + "THURSDAY": SnapshotScheduleDayOfWeekThursday, + "FRIDAY": SnapshotScheduleDayOfWeekFriday, + "SATURDAY": SnapshotScheduleDayOfWeekSaturday, + "SUNDAY": SnapshotScheduleDayOfWeekSunday, +} + +var mappingSnapshotScheduleDayOfWeekEnumLowerCase = map[string]SnapshotScheduleDayOfWeekEnum{ + "monday": SnapshotScheduleDayOfWeekMonday, + "tuesday": SnapshotScheduleDayOfWeekTuesday, + "wednesday": SnapshotScheduleDayOfWeekWednesday, + "thursday": SnapshotScheduleDayOfWeekThursday, + "friday": SnapshotScheduleDayOfWeekFriday, + "saturday": SnapshotScheduleDayOfWeekSaturday, + "sunday": SnapshotScheduleDayOfWeekSunday, +} + +// GetSnapshotScheduleDayOfWeekEnumValues Enumerates the set of values for SnapshotScheduleDayOfWeekEnum +func GetSnapshotScheduleDayOfWeekEnumValues() []SnapshotScheduleDayOfWeekEnum { + values := make([]SnapshotScheduleDayOfWeekEnum, 0) + for _, v := range mappingSnapshotScheduleDayOfWeekEnum { + values = append(values, v) + } + return values +} + +// GetSnapshotScheduleDayOfWeekEnumStringValues Enumerates the set of values in String for SnapshotScheduleDayOfWeekEnum +func GetSnapshotScheduleDayOfWeekEnumStringValues() []string { + return []string{ + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY", + } +} + +// GetMappingSnapshotScheduleDayOfWeekEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSnapshotScheduleDayOfWeekEnum(val string) (SnapshotScheduleDayOfWeekEnum, bool) { + enum, ok := mappingSnapshotScheduleDayOfWeekEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SnapshotScheduleMonthEnum Enum with underlying type: string +type SnapshotScheduleMonthEnum string + +// Set of constants representing the allowable values for SnapshotScheduleMonthEnum +const ( + SnapshotScheduleMonthJanuary SnapshotScheduleMonthEnum = "JANUARY" + SnapshotScheduleMonthFebruary SnapshotScheduleMonthEnum = "FEBRUARY" + SnapshotScheduleMonthMarch SnapshotScheduleMonthEnum = "MARCH" + SnapshotScheduleMonthApril SnapshotScheduleMonthEnum = "APRIL" + SnapshotScheduleMonthMay SnapshotScheduleMonthEnum = "MAY" + SnapshotScheduleMonthJune SnapshotScheduleMonthEnum = "JUNE" + SnapshotScheduleMonthJuly SnapshotScheduleMonthEnum = "JULY" + SnapshotScheduleMonthAugust SnapshotScheduleMonthEnum = "AUGUST" + SnapshotScheduleMonthSeptember SnapshotScheduleMonthEnum = "SEPTEMBER" + SnapshotScheduleMonthOctober SnapshotScheduleMonthEnum = "OCTOBER" + SnapshotScheduleMonthNovember SnapshotScheduleMonthEnum = "NOVEMBER" + SnapshotScheduleMonthDecember SnapshotScheduleMonthEnum = "DECEMBER" +) + +var mappingSnapshotScheduleMonthEnum = map[string]SnapshotScheduleMonthEnum{ + "JANUARY": SnapshotScheduleMonthJanuary, + "FEBRUARY": SnapshotScheduleMonthFebruary, + "MARCH": SnapshotScheduleMonthMarch, + "APRIL": SnapshotScheduleMonthApril, + "MAY": SnapshotScheduleMonthMay, + "JUNE": SnapshotScheduleMonthJune, + "JULY": SnapshotScheduleMonthJuly, + "AUGUST": SnapshotScheduleMonthAugust, + "SEPTEMBER": SnapshotScheduleMonthSeptember, + "OCTOBER": SnapshotScheduleMonthOctober, + "NOVEMBER": SnapshotScheduleMonthNovember, + "DECEMBER": SnapshotScheduleMonthDecember, +} + +var mappingSnapshotScheduleMonthEnumLowerCase = map[string]SnapshotScheduleMonthEnum{ + "january": SnapshotScheduleMonthJanuary, + "february": SnapshotScheduleMonthFebruary, + "march": SnapshotScheduleMonthMarch, + "april": SnapshotScheduleMonthApril, + "may": SnapshotScheduleMonthMay, + "june": SnapshotScheduleMonthJune, + "july": SnapshotScheduleMonthJuly, + "august": SnapshotScheduleMonthAugust, + "september": SnapshotScheduleMonthSeptember, + "october": SnapshotScheduleMonthOctober, + "november": SnapshotScheduleMonthNovember, + "december": SnapshotScheduleMonthDecember, +} + +// GetSnapshotScheduleMonthEnumValues Enumerates the set of values for SnapshotScheduleMonthEnum +func GetSnapshotScheduleMonthEnumValues() []SnapshotScheduleMonthEnum { + values := make([]SnapshotScheduleMonthEnum, 0) + for _, v := range mappingSnapshotScheduleMonthEnum { + values = append(values, v) + } + return values +} + +// GetSnapshotScheduleMonthEnumStringValues Enumerates the set of values in String for SnapshotScheduleMonthEnum +func GetSnapshotScheduleMonthEnumStringValues() []string { + return []string{ + "JANUARY", + "FEBRUARY", + "MARCH", + "APRIL", + "MAY", + "JUNE", + "JULY", + "AUGUST", + "SEPTEMBER", + "OCTOBER", + "NOVEMBER", + "DECEMBER", + } +} + +// GetMappingSnapshotScheduleMonthEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSnapshotScheduleMonthEnum(val string) (SnapshotScheduleMonthEnum, bool) { + enum, ok := mappingSnapshotScheduleMonthEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/filestorage/snapshot_summary.go b/filestorage/snapshot_summary.go index 44a5f03b0e..be3f06805e 100644 --- a/filestorage/snapshot_summary.go +++ b/filestorage/snapshot_summary.go @@ -51,6 +51,9 @@ type SnapshotSummary struct { // Example: `2020-08-25T21:10:29.600Z` SnapshotTime *common.SDKTime `mandatory:"false" json:"snapshotTime"` + // The time when this snapshot will be deleted. + ExpirationTime *common.SDKTime `mandatory:"false" json:"expirationTime"` + // An OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) identifying the parent from which this snapshot was cloned. // If this snapshot was not cloned, then the `provenanceId` is the same as the snapshot `id` value. // If this snapshot was cloned, then the `provenanceId` value is the parent's `provenanceId`. diff --git a/filestorage/unpause_filesystem_snapshot_policy_request_response.go b/filestorage/unpause_filesystem_snapshot_policy_request_response.go new file mode 100644 index 0000000000..6de88dbda3 --- /dev/null +++ b/filestorage/unpause_filesystem_snapshot_policy_request_response.go @@ -0,0 +1,102 @@ +// 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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UnpauseFilesystemSnapshotPolicyRequest wrapper for the UnpauseFilesystemSnapshotPolicy operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/UnpauseFilesystemSnapshotPolicy.go.html to see an example of how to use UnpauseFilesystemSnapshotPolicyRequest. +type UnpauseFilesystemSnapshotPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy. + FilesystemSnapshotPolicyId *string `mandatory:"true" contributesTo:"path" name:"filesystemSnapshotPolicyId"` + + // 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 UnpauseFilesystemSnapshotPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UnpauseFilesystemSnapshotPolicyRequest) 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 UnpauseFilesystemSnapshotPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UnpauseFilesystemSnapshotPolicyRequest) 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 UnpauseFilesystemSnapshotPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnpauseFilesystemSnapshotPolicyResponse wrapper for the UnpauseFilesystemSnapshotPolicy operation +type UnpauseFilesystemSnapshotPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The FilesystemSnapshotPolicy instance + FilesystemSnapshotPolicy `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 UnpauseFilesystemSnapshotPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UnpauseFilesystemSnapshotPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/filestorage/update_file_system_details.go b/filestorage/update_file_system_details.go index 92f3a8266e..e76a1a666a 100644 --- a/filestorage/update_file_system_details.go +++ b/filestorage/update_file_system_details.go @@ -41,6 +41,11 @@ type UpdateFileSystemDetails struct { // If updating to a new Key Management key, the old key must remain enabled so that files previously encrypted continue // to be accessible. For more information, see Overview of Key Management (https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm). KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the associated file system snapshot policy, which + // controls the frequency of snapshot creation and retention period of the taken snapshots. + // If string is empty, the policy reference (if any) would be removed. + FilesystemSnapshotPolicyId *string `mandatory:"false" json:"filesystemSnapshotPolicyId"` } func (m UpdateFileSystemDetails) String() string { diff --git a/filestorage/update_filesystem_snapshot_policy_details.go b/filestorage/update_filesystem_snapshot_policy_details.go new file mode 100644 index 0000000000..7b8951ddfe --- /dev/null +++ b/filestorage/update_filesystem_snapshot_policy_details.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. + +// File Storage API +// +// Use the File Storage service API to manage file systems, mount targets, and snapshots. +// For more information, see Overview of File Storage (https://docs.cloud.oracle.com/iaas/Content/File/Concepts/filestorageoverview.htm). +// + +package filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateFilesystemSnapshotPolicyDetails Details for updating the file system snapshot policy. +type UpdateFilesystemSnapshotPolicyDetails struct { + + // A user-friendly name. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + // Example: `policy1` + DisplayName *string `mandatory:"false" json:"displayName"` + + // The prefix to apply to all snapshots created by this policy. + // Example: `acme` + PolicyPrefix *string `mandatory:"false" json:"policyPrefix"` + + // The list of associated snapshot schedules. A maximum of 10 schedules can be associated with a policy. + // If using the CLI, provide the schedule as a list of JSON strings, with the list wrapped in + // quotation marks, i.e. + // ``` + // --schedules '[{"timeZone":"UTC","period":"DAILY","hourOfDay":18},{"timeZone":"UTC","period":"HOURLY"}]' + // ``` + Schedules []SnapshotSchedule `mandatory:"false" json:"schedules"` + + // 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 UpdateFilesystemSnapshotPolicyDetails) 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 UpdateFilesystemSnapshotPolicyDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/filestorage/update_filesystem_snapshot_policy_request_response.go b/filestorage/update_filesystem_snapshot_policy_request_response.go new file mode 100644 index 0000000000..7d4b9be5a8 --- /dev/null +++ b/filestorage/update_filesystem_snapshot_policy_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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateFilesystemSnapshotPolicyRequest wrapper for the UpdateFilesystemSnapshotPolicy operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/UpdateFilesystemSnapshotPolicy.go.html to see an example of how to use UpdateFilesystemSnapshotPolicyRequest. +type UpdateFilesystemSnapshotPolicyRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system snapshot policy. + FilesystemSnapshotPolicyId *string `mandatory:"true" contributesTo:"path" name:"filesystemSnapshotPolicyId"` + + // Details object for updating a file system snapshot policy. + UpdateFilesystemSnapshotPolicyDetails `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 UpdateFilesystemSnapshotPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateFilesystemSnapshotPolicyRequest) 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 UpdateFilesystemSnapshotPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateFilesystemSnapshotPolicyRequest) 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 UpdateFilesystemSnapshotPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateFilesystemSnapshotPolicyResponse wrapper for the UpdateFilesystemSnapshotPolicy operation +type UpdateFilesystemSnapshotPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The FilesystemSnapshotPolicy instance + FilesystemSnapshotPolicy `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 UpdateFilesystemSnapshotPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateFilesystemSnapshotPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/filestorage/update_snapshot_details.go b/filestorage/update_snapshot_details.go index 540687c49b..898f959351 100644 --- a/filestorage/update_snapshot_details.go +++ b/filestorage/update_snapshot_details.go @@ -29,6 +29,10 @@ type UpdateSnapshotDetails struct { // 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"` + + // The UTC time when this snapshot will be deleted. To remove the expiration time, set this field to the minimum date-time value using Date(0). + // Example: `Thu Jan 01 01:00:00 GMT 1970` + ExpirationTime *common.SDKTime `mandatory:"false" json:"expirationTime"` } func (m UpdateSnapshotDetails) String() string { diff --git a/managementdashboard/create_management_dashboard_details.go b/managementdashboard/create_management_dashboard_details.go index 77eaf8f4bd..fe756d58e0 100644 --- a/managementdashboard/create_management_dashboard_details.go +++ b/managementdashboard/create_management_dashboard_details.go @@ -22,10 +22,10 @@ type CreateManagementDashboardDetails struct { // ID of the service (for example, log-analytics) that owns the dashboard. Each service has a unique ID. ProviderId *string `mandatory:"true" json:"providerId"` - // Name of the service (for example, Logging Analytics) that owns the dashboard. + // The user friendly name of the service (for example, Logging Analytics) that owns the dashboard. ProviderName *string `mandatory:"true" json:"providerName"` - // Version of the service that owns the dashboard. + // The version of the metadata of the provider. This is useful for provider to version its features and metadata. Any newly created saved search (or dashboard) should use providerVersion 3.0.0. ProviderVersion *string `mandatory:"true" json:"providerVersion"` // Array of dashboard tiles. @@ -46,7 +46,7 @@ type CreateManagementDashboardDetails struct { // Determines whether the dashboard will be displayed in Dashboard Home. IsShowInHome *bool `mandatory:"true" json:"isShowInHome"` - // Version of the metadata. + // The version of the metadata defined in the API. This is maintained and enforced by dashboard server. Currently it is 2.0. MetadataVersion *string `mandatory:"true" json:"metadataVersion"` // Determines whether the description of the dashboard is displayed. @@ -76,6 +76,9 @@ type CreateManagementDashboardDetails struct { // Defines parameters for the dashboard. ParametersConfig []interface{} `mandatory:"false" json:"parametersConfig"` + // Contains configuration for enabling features. + FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` + // Drill-down configuration to define the destination of a drill-down action. DrilldownConfig []interface{} `mandatory:"false" json:"drilldownConfig"` diff --git a/managementdashboard/create_management_saved_search_details.go b/managementdashboard/create_management_saved_search_details.go index d947e103ac..d254a5ff9a 100644 --- a/managementdashboard/create_management_saved_search_details.go +++ b/managementdashboard/create_management_saved_search_details.go @@ -25,10 +25,10 @@ type CreateManagementSavedSearchDetails struct { // ID of the service (for example log-analytics) that owns the saved search. Each service has a unique ID. ProviderId *string `mandatory:"true" json:"providerId"` - // Version of the service that owns this saved search. + // The version of the metadata of the provider. This is useful for provider to version its features and metadata. Any newly created saved search (or dashboard) should use providerVersion 3.0.0. ProviderVersion *string `mandatory:"true" json:"providerVersion"` - // Name of the service (for example, Logging Analytics) that owns the saved search. + // The user friendly name of the service (for example, Logging Analytics) that owns the saved search. ProviderName *string `mandatory:"true" json:"providerName"` // OCID of the compartment in which the saved search resides. @@ -46,22 +46,22 @@ type CreateManagementSavedSearchDetails struct { // Determines how the saved search is displayed in a dashboard. Type SavedSearchTypesEnum `mandatory:"true" json:"type"` - // JSON that contains user interface options. + // It defines the visualization type of the widget saved search, the UI options of that visualization type, the binding of data to the visualization. UiConfig *interface{} `mandatory:"true" json:"uiConfig"` - // Array of JSON that contain data source options. + // It defines how data is fetched. A functional saved search needs a valid dataConfig. See examples on how it can be constructed for various data sources. DataConfig []interface{} `mandatory:"true" json:"dataConfig"` // Screen image of the saved search. ScreenImage *string `mandatory:"true" json:"screenImage"` - // Version of the metadata. + // The version of the metadata defined in the API. This is maintained and enforced by dashboard server. Currently it is 2.0. MetadataVersion *string `mandatory:"true" json:"metadataVersion"` - // Reference to the HTML file of the widget. + // The UI template that the saved search uses to render itself. WidgetTemplate *string `mandatory:"true" json:"widgetTemplate"` - // Reference to the view model of the widget. + // The View Model that the saved search uses to render itself. WidgetVM *string `mandatory:"true" json:"widgetVM"` // ID of the saved search, which must only be provided for Out-of-the-Box (OOB) saved search. @@ -70,6 +70,9 @@ type CreateManagementSavedSearchDetails struct { // Defines parameters for the saved search. ParametersConfig []interface{} `mandatory:"false" json:"parametersConfig"` + // Contains configuration for enabling features. + FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` + // Drill-down configuration to define the destination of a drill-down action. DrilldownConfig []interface{} `mandatory:"false" json:"drilldownConfig"` diff --git a/managementdashboard/management_dashboard.go b/managementdashboard/management_dashboard.go index d5fe0d496d..9fec173dff 100644 --- a/managementdashboard/management_dashboard.go +++ b/managementdashboard/management_dashboard.go @@ -64,7 +64,7 @@ type ManagementDashboard struct { // Date and time the dashboard was updated. TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` - // Version of the metadata. + // The version of the metadata defined in the API. This is maintained and enforced by dashboard server. Currently it is 2.0. MetadataVersion *string `mandatory:"true" json:"metadataVersion"` // Determines whether the description of the dashboard is displayed. @@ -100,6 +100,9 @@ type ManagementDashboard struct { // Drill-down configuration to define the destination of a drill-down action. DrilldownConfig []interface{} `mandatory:"false" json:"drilldownConfig"` + // Contains configuration for enabling features. + FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` + // 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"` diff --git a/managementdashboard/management_dashboard_for_import_export_details.go b/managementdashboard/management_dashboard_for_import_export_details.go index e5e960cb18..a864464744 100644 --- a/managementdashboard/management_dashboard_for_import_export_details.go +++ b/managementdashboard/management_dashboard_for_import_export_details.go @@ -25,10 +25,10 @@ type ManagementDashboardForImportExportDetails struct { // ID of the service (for example log-analytics) that owns the dashboard. Each service has a unique ID. ProviderId *string `mandatory:"true" json:"providerId"` - // Name of the service (for example, Logging Analytics) that owns the dashboard. + // The user friendly name of the service (for example, Logging Analytics) that owns the dashboard. ProviderName *string `mandatory:"true" json:"providerName"` - // Version of the service that owns the dashboard. + // The version of the metadata of the provider. This is useful for provider to version its features and metadata. Any newly created saved search (or dashboard) should use providerVersion 3.0.0. ProviderVersion *string `mandatory:"true" json:"providerVersion"` // Array of dashboard tiles. @@ -49,7 +49,7 @@ type ManagementDashboardForImportExportDetails struct { // Determines whether the dashboard will be displayed in Dashboard Home. IsShowInHome *bool `mandatory:"true" json:"isShowInHome"` - // Version of the metadata. + // The version of the metadata defined in the API. This is maintained and enforced by dashboard server. Currently it is 2.0. MetadataVersion *string `mandatory:"true" json:"metadataVersion"` // Determines whether the description of the dashboard is displayed. @@ -61,10 +61,10 @@ type ManagementDashboardForImportExportDetails struct { // JSON that contains internationalization options. Nls *interface{} `mandatory:"true" json:"nls"` - // JSON that contains user interface options. + // It defines the visualization type of the widget saved search, the UI options of that visualization type, the binding of data to the visualization. UiConfig *interface{} `mandatory:"true" json:"uiConfig"` - // Array of JSON that contain data source options. + // It defines how data is fetched. A functional saved search needs a valid dataConfig. See examples on how it can be constructed for various data sources. DataConfig []interface{} `mandatory:"true" json:"dataConfig"` // Type of dashboard. NORMAL denotes a single dashboard and SET denotes a dashboard set. @@ -79,6 +79,9 @@ type ManagementDashboardForImportExportDetails struct { // Defines parameters for the dashboard. ParametersConfig []interface{} `mandatory:"false" json:"parametersConfig"` + // Contains configuration for enabling features. + FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` + // Drill-down configuration to define the destination of a drill-down action. DrilldownConfig []interface{} `mandatory:"false" json:"drilldownConfig"` diff --git a/managementdashboard/management_dashboard_summary.go b/managementdashboard/management_dashboard_summary.go index dc3c87cf96..2e6cc2a334 100644 --- a/managementdashboard/management_dashboard_summary.go +++ b/managementdashboard/management_dashboard_summary.go @@ -37,10 +37,10 @@ type ManagementDashboardSummary struct { // ID of the service (for example, log-analytics) that owns the dashboard. Each service has a unique ID. ProviderId *string `mandatory:"true" json:"providerId"` - // Name of the service (for example, Logging Analytics) that owns the dashboard. + // The user friendly name of the service (for example, Logging Analytics) that owns the dashboard. ProviderName *string `mandatory:"true" json:"providerName"` - // Version of the service that owns the dashboard. + // The version of the metadata of the provider. This is useful for provider to version its features and metadata. Any newly created saved search (or dashboard) should use providerVersion 3.0.0. ProviderVersion *string `mandatory:"true" json:"providerVersion"` // Determines whether the dashboard is an Out-of-the-Box (OOB) dashboard. Note that OOB dashboards are only provided by Oracle and cannot be modified. @@ -58,7 +58,7 @@ type ManagementDashboardSummary struct { // Date and time the dashboard was updated. TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` - // Version of the metadata. + // The version of the metadata defined in the API. This is maintained and enforced by dashboard server. Currently it is 2.0. MetadataVersion *string `mandatory:"true" json:"metadataVersion"` // Screen image of the dashboard. @@ -80,6 +80,9 @@ type ManagementDashboardSummary struct { // 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:"true" json:"definedTags"` + + // Contains configuration for enabling features. + FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` } func (m ManagementDashboardSummary) String() string { diff --git a/managementdashboard/management_dashboard_tile_details.go b/managementdashboard/management_dashboard_tile_details.go index 6a92b9856f..a9e13bcd46 100644 --- a/managementdashboard/management_dashboard_tile_details.go +++ b/managementdashboard/management_dashboard_tile_details.go @@ -41,10 +41,10 @@ type ManagementDashboardTileDetails struct { // JSON that contains internationalization options. Nls *interface{} `mandatory:"true" json:"nls"` - // JSON that contains user interface options. + // It defines the visualization type of the widget saved search, the UI options of that visualization type, the binding of data to the visualization. UiConfig *interface{} `mandatory:"true" json:"uiConfig"` - // Array of JSON that contain data source options. + // It defines how data is fetched. A functional saved search needs a valid dataConfig. See examples on how it can be constructed for various data sources. DataConfig []interface{} `mandatory:"true" json:"dataConfig"` // Current state of the saved search. diff --git a/managementdashboard/management_saved_search.go b/managementdashboard/management_saved_search.go index 96e9cd44d2..1605fad165 100644 --- a/managementdashboard/management_saved_search.go +++ b/managementdashboard/management_saved_search.go @@ -49,16 +49,16 @@ type ManagementSavedSearch struct { // Determines how the saved search is displayed in a dashboard. Type SavedSearchTypesEnum `mandatory:"true" json:"type"` - // JSON that contains user interface options. + // It defines the visualization type of the widget saved search, the UI options of that visualization type, the binding of data to the visualization. UiConfig *interface{} `mandatory:"true" json:"uiConfig"` - // Array of JSON that contain data source options. + // It defines how data is fetched. A functional saved search needs a valid dataConfig. See examples on how it can be constructed for various data sources. DataConfig []interface{} `mandatory:"true" json:"dataConfig"` - // User who created the saved search. + // The principle id of the user that created this saved search. This is automatically managed by the system. In OCI the value is ignored. In EM it can skipped or otherwise it is ignored in both create and update API and system automatically sets its value. CreatedBy *string `mandatory:"true" json:"createdBy"` - // User who updated the saved search. + // The principle id of the user that updated this saved search. UpdatedBy *string `mandatory:"true" json:"updatedBy"` // Date and time the saved search was created. @@ -70,21 +70,24 @@ type ManagementSavedSearch struct { // Screen image of the saved search. ScreenImage *string `mandatory:"true" json:"screenImage"` - // Version of the metadata. + // The version of the metadata defined in the API. This is maintained and enforced by dashboard server. Currently it is 2.0. MetadataVersion *string `mandatory:"true" json:"metadataVersion"` - // Reference to the HTML file of the widget. + // The UI template that the saved search uses to render itself. WidgetTemplate *string `mandatory:"true" json:"widgetTemplate"` - // Reference to the view model of the widget. + // The View Model that the saved search uses to render itself. WidgetVM *string `mandatory:"true" json:"widgetVM"` - // State of dashboard. + // OCI lifecycle status. This is automatically managed by the system. LifecycleState LifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` // Defines parameters for the saved search. ParametersConfig []interface{} `mandatory:"false" json:"parametersConfig"` + // Contains configuration for enabling features. + FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` + // Drill-down configuration to define the destination of a drill-down action. DrilldownConfig []interface{} `mandatory:"false" json:"drilldownConfig"` diff --git a/managementdashboard/management_saved_search_for_import_details.go b/managementdashboard/management_saved_search_for_import_details.go index f28cea0d57..87e5ba441d 100644 --- a/managementdashboard/management_saved_search_for_import_details.go +++ b/managementdashboard/management_saved_search_for_import_details.go @@ -28,10 +28,10 @@ type ManagementSavedSearchForImportDetails struct { // ID of the service (for example log-analytics) that owns the saved search. Each service has a unique ID. ProviderId *string `mandatory:"true" json:"providerId"` - // Version of the service that owns this saved search. + // The version of the metadata of the provider. This is useful for provider to version its features and metadata. Any newly created saved search (or dashboard) should use providerVersion 3.0.0. ProviderVersion *string `mandatory:"true" json:"providerVersion"` - // Name of the service (for example, Logging Analytics) that owns the saved search. + // The user friendly name of the service (for example, Logging Analytics) that owns the saved search. ProviderName *string `mandatory:"true" json:"providerName"` // OCID of the compartment in which the saved search resides. @@ -49,22 +49,22 @@ type ManagementSavedSearchForImportDetails struct { // Determines how the saved search is displayed in a dashboard. Type SavedSearchTypesEnum `mandatory:"true" json:"type"` - // JSON that contains user interface options. + // It defines the visualization type of the widget saved search, the UI options of that visualization type, the binding of data to the visualization. UiConfig *interface{} `mandatory:"true" json:"uiConfig"` - // Array of JSON that contain data source options. + // It defines how data is fetched. A functional saved search needs a valid dataConfig. See examples on how it can be constructed for various data sources. DataConfig []interface{} `mandatory:"true" json:"dataConfig"` // Screen image of the saved search. ScreenImage *string `mandatory:"true" json:"screenImage"` - // Version of the metadata. + // The version of the metadata defined in the API. This is maintained and enforced by dashboard server. Currently it is 2.0. MetadataVersion *string `mandatory:"true" json:"metadataVersion"` - // Reference to the HTML file of the widget. + // The UI template that the saved search uses to render itself. WidgetTemplate *string `mandatory:"true" json:"widgetTemplate"` - // Reference to the view model of the widget. + // The View Model that the saved search uses to render itself. WidgetVM *string `mandatory:"true" json:"widgetVM"` // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. @@ -78,6 +78,9 @@ type ManagementSavedSearchForImportDetails struct { // Defines parameters for the saved search. ParametersConfig []interface{} `mandatory:"false" json:"parametersConfig"` + // Contains configuration for enabling features. + FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` + // Drill-down configuration to define the destination of a drill-down action. DrilldownConfig []interface{} `mandatory:"false" json:"drilldownConfig"` } diff --git a/managementdashboard/management_saved_search_summary.go b/managementdashboard/management_saved_search_summary.go index 0afa04417b..ced133e35c 100644 --- a/managementdashboard/management_saved_search_summary.go +++ b/managementdashboard/management_saved_search_summary.go @@ -34,10 +34,10 @@ type ManagementSavedSearchSummary struct { // ID of the service (for example log-analytics) that owns the saved search. Each service has a unique ID. ProviderId *string `mandatory:"true" json:"providerId"` - // Version of the service that owns this saved search. + // The version of the metadata of the provider. This is useful for provider to version its features and metadata. Any newly created saved search (or dashboard) should use providerVersion 3.0.0. ProviderVersion *string `mandatory:"true" json:"providerVersion"` - // Name of the service (for example, Logging Analytics) that owns the saved search. + // The user friendly name of the service (for example, Logging Analytics) that owns the saved search. ProviderName *string `mandatory:"true" json:"providerName"` // Description of the saved search. @@ -49,16 +49,16 @@ type ManagementSavedSearchSummary struct { // Determines how the saved search is displayed in a dashboard. Type SavedSearchTypesEnum `mandatory:"true" json:"type"` - // JSON that contains user interface options. + // It defines the visualization type of the widget saved search, the UI options of that visualization type, the binding of data to the visualization. UiConfig *interface{} `mandatory:"true" json:"uiConfig"` - // Array of JSON that contain data source options. + // It defines how data is fetched. A functional saved search needs a valid dataConfig. See examples on how it can be constructed for various data sources. DataConfig []interface{} `mandatory:"true" json:"dataConfig"` - // User who created the saved search. + // The principle id of the user that created this saved search. This is automatically managed by the system. In OCI the value is ignored. In EM it can skipped or otherwise it is ignored in both create and update API and system automatically sets its value. CreatedBy *string `mandatory:"true" json:"createdBy"` - // User who updated the saved search. + // The principle id of the user that updated this saved search UpdatedBy *string `mandatory:"true" json:"updatedBy"` // Date and time the saved search was created. @@ -70,21 +70,24 @@ type ManagementSavedSearchSummary struct { // Screen image of the saved search. ScreenImage *string `mandatory:"true" json:"screenImage"` - // Version of the metadata. + // The version of the metadata defined in the API. This is maintained and enforced by dashboard server. Currently it is 2.0. MetadataVersion *string `mandatory:"true" json:"metadataVersion"` - // Reference to the HTML file of the widget. + // The UI template that the saved search uses to render itself. WidgetTemplate *string `mandatory:"true" json:"widgetTemplate"` - // Reference to the view model of the widget. + // The View Model that the saved search uses to render itself. WidgetVM *string `mandatory:"true" json:"widgetVM"` - // Current lifecycle state of the saved search. + // OCI lifecycle status. This is automatically managed by the system. LifecycleState LifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` // Defines parameters for the saved search. ParametersConfig []interface{} `mandatory:"false" json:"parametersConfig"` + // Contains configuration for enabling features. + FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` + // 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"` diff --git a/managementdashboard/update_management_dashboard_details.go b/managementdashboard/update_management_dashboard_details.go index eda9b0db4a..40e517a74d 100644 --- a/managementdashboard/update_management_dashboard_details.go +++ b/managementdashboard/update_management_dashboard_details.go @@ -22,10 +22,10 @@ type UpdateManagementDashboardDetails struct { // ID of the service (for example, log-analytics) that owns the dashboard. Each service has a unique ID. ProviderId *string `mandatory:"false" json:"providerId"` - // Name of the service (for example, Logging Analytics) that owns the dashboard. + // The user friendly name of the service (for example, Logging Analytics) that owns the dashboard. ProviderName *string `mandatory:"false" json:"providerName"` - // Version of the service that owns the dashboard. + // The version of the metadata of the provider. This is useful for provider to version its features and metadata. Any newly created saved search (or dashboard) should use providerVersion 3.0.0. ProviderVersion *string `mandatory:"false" json:"providerVersion"` // Array of dashboard tiles. @@ -46,7 +46,7 @@ type UpdateManagementDashboardDetails struct { // Determines whether the dashboard will be displayed in Dashboard Home. IsShowInHome *bool `mandatory:"false" json:"isShowInHome"` - // Version of the metadata. + // The version of the metadata defined in the API. This is maintained and enforced by dashboard server. Currently it is 2.0. MetadataVersion *string `mandatory:"false" json:"metadataVersion"` // Determines whether the description of the dashboard is displayed. @@ -73,6 +73,9 @@ type UpdateManagementDashboardDetails struct { // Defines parameters for the dashboard. ParametersConfig []interface{} `mandatory:"false" json:"parametersConfig"` + // Contains configuration for enabling features. + FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` + // Drill-down configuration to define the destination of a drill-down action. DrilldownConfig []interface{} `mandatory:"false" json:"drilldownConfig"` diff --git a/managementdashboard/update_management_saved_search_details.go b/managementdashboard/update_management_saved_search_details.go index 5a0f931463..42ed9b8035 100644 --- a/managementdashboard/update_management_saved_search_details.go +++ b/managementdashboard/update_management_saved_search_details.go @@ -25,10 +25,10 @@ type UpdateManagementSavedSearchDetails struct { // ID of the service (for example log-analytics) that owns the saved search. Each service has a unique ID. ProviderId *string `mandatory:"false" json:"providerId"` - // Version of the service that owns this saved search. + // The version of the metadata of the provider. This is useful for provider to version its features and metadata. Any newly created saved search (or dashboard) should use providerVersion 3.0.0. ProviderVersion *string `mandatory:"false" json:"providerVersion"` - // Name of the service (for example, Logging Analytics) that owns the saved search. + // The user friendly name of the service (for example, Logging Analytics) that owns the saved search. ProviderName *string `mandatory:"false" json:"providerName"` // OCID of the compartment in which the saved search resides. @@ -46,27 +46,30 @@ type UpdateManagementSavedSearchDetails struct { // Determines how the saved search is displayed in a dashboard. Type SavedSearchTypesEnum `mandatory:"false" json:"type,omitempty"` - // JSON that contains user interface options. + // It defines the visualization type of the widget saved search, the UI options of that visualization type, the binding of data to the visualization. UiConfig *interface{} `mandatory:"false" json:"uiConfig"` - // Array of JSON that contain data source options. + // It defines how data is fetched. A functional saved search needs a valid dataConfig. See examples on how it can be constructed for various data sources. DataConfig []interface{} `mandatory:"false" json:"dataConfig"` // Screen image of the saved search. ScreenImage *string `mandatory:"false" json:"screenImage"` - // Version of the metadata. + // The version of the metadata defined in the API. This is maintained and enforced by dashboard server. Currently it is 2.0. MetadataVersion *string `mandatory:"false" json:"metadataVersion"` - // Reference to the HTML file of the widget. + // The UI template that the saved search uses to render itself. WidgetTemplate *string `mandatory:"false" json:"widgetTemplate"` - // Reference to the view model of the widget. + // The View Model that the saved search uses to render itself. WidgetVM *string `mandatory:"false" json:"widgetVM"` // Defines parameters for the saved search. ParametersConfig []interface{} `mandatory:"false" json:"parametersConfig"` + // Contains configuration for enabling features. + FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` + // Drill-down configuration to define the destination of a drill-down action. DrilldownConfig []interface{} `mandatory:"false" json:"drilldownConfig"`