resourceconfigurationv1

package
v2.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Overview

Package resourceconfigurationv1 : Operations and models for the ResourceConfigurationV1 service

Index

Constants

View Source
const (
	ProtectionManagement_RequestedState_Activate   = "activate"
	ProtectionManagement_RequestedState_Deactivate = "deactivate"
)

Constants associated with the ProtectionManagement.RequestedState property. If set to `activate`, protection management action on the bucket is being activated.

View Source
const DefaultServiceName = "resource_configuration"

DefaultServiceName is the default key used to find external configuration information.

View Source
const DefaultServiceURL = "https://config.cloud-object-storage.cloud.ibm.com/v1"

DefaultServiceURL is the default URL to make service requests to.

Variables

This section is empty.

Functions

func GetServiceURLForRegion

func GetServiceURLForRegion(region string) (string, error)

GetServiceURLForRegion returns the service URL to be used for the specified region

func UnmarshalActivityTracking

func UnmarshalActivityTracking(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalActivityTracking unmarshals an instance of ActivityTracking from the specified map of raw messages.

func UnmarshalBucket

func UnmarshalBucket(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalBucket unmarshals an instance of Bucket from the specified map of raw messages.

func UnmarshalBucketPatch

func UnmarshalBucketPatch(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalBucketPatch unmarshals an instance of BucketPatch from the specified map of raw messages.

func UnmarshalFirewall

func UnmarshalFirewall(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalFirewall unmarshals an instance of Firewall from the specified map of raw messages.

func UnmarshalMetricsMonitoring

func UnmarshalMetricsMonitoring(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalMetricsMonitoring unmarshals an instance of MetricsMonitoring from the specified map of raw messages.

func UnmarshalProtectionManagement added in v2.0.4

func UnmarshalProtectionManagement(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalProtectionManagement unmarshals an instance of ProtectionManagement from the specified map of raw messages.

func UnmarshalProtectionManagementResponse added in v2.0.4

func UnmarshalProtectionManagementResponse(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalProtectionManagementResponse unmarshals an instance of ProtectionManagementResponse from the specified map of raw messages.

func UnmarshalProtectionManagementResponseTokenEntry added in v2.0.4

func UnmarshalProtectionManagementResponseTokenEntry(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalProtectionManagementResponseTokenEntry unmarshals an instance of ProtectionManagementResponseTokenEntry from the specified map of raw messages.

Types

type ActivityTracking

type ActivityTracking struct {
	// If set to `true`, all object read events (i.e. downloads) will be sent to Activity Tracker.
	ReadDataEvents *bool `json:"read_data_events,omitempty"`

	// If set to `true`, all object write events (i.e. uploads) will be sent to Activity Tracker.
	WriteDataEvents *bool `json:"write_data_events,omitempty"`

	// Required the first time `activity_tracking` is configured. The instance of Activity Tracker that will receive object
	// event data. The format is "crn:v1:bluemix:public:logdnaat:{bucket location}:a/{storage account}:{activity tracker
	// service instance}::".
	ActivityTrackerCrn *string `json:"activity_tracker_crn,omitempty"`
}

ActivityTracking : Enables sending log data to IBM Cloud Activity Tracker to provide visibility into object read and write events. All object events are sent to the activity tracker instance defined in the `activity_tracker_crn` field.

type Bucket

type Bucket struct {
	// The name of the bucket. Non-mutable.
	Name *string `json:"name,omitempty"`

	// The service instance that holds the bucket. Non-mutable.
	Crn *string `json:"crn,omitempty"`

	// The service instance that holds the bucket. Non-mutable.
	ServiceInstanceID *string `json:"service_instance_id,omitempty"`

	// The service instance that holds the bucket. Non-mutable.
	ServiceInstanceCrn *string `json:"service_instance_crn,omitempty"`

	// The creation time of the bucket in RFC 3339 format. Non-mutable.
	TimeCreated *strfmt.DateTime `json:"time_created,omitempty"`

	// The modification time of the bucket in RFC 3339 format. Non-mutable.
	TimeUpdated *strfmt.DateTime `json:"time_updated,omitempty"`

	// Total number of objects in the bucket. Non-mutable.
	ObjectCount *int64 `json:"object_count,omitempty"`

	// Total size of all objects in the bucket. Non-mutable.
	BytesUsed *int64 `json:"bytes_used,omitempty"`

	// Number of non-current object versions in the bucket. Non-mutable.
	NoncurrentObjectCount *int64 `json:"noncurrent_object_count,omitempty"`

	// Total size of all non-current object versions in the bucket. Non-mutable.
	NoncurrentBytesUsed *int64 `json:"noncurrent_bytes_used,omitempty"`

	// Total number of delete markers in the bucket. Non-mutable.
	DeleteMarkerCount *int64 `json:"delete_marker_count,omitempty"`

	// An access control mechanism based on the network (IP address) where request originated. Requests not originating
	// from IP addresses listed in the `allowed_ip` field will be denied regardless of any access policies (including
	// public access) that might otherwise permit the request.  Viewing or updating the `Firewall` element requires the
	// requester to have the `manager` role.
	Firewall *Firewall `json:"firewall,omitempty"`

	// Enables sending log data to IBM Cloud Activity Tracker to provide visibility into object read and write events. All
	// object events are sent to the activity tracker instance defined in the `activity_tracker_crn` field.
	ActivityTracking *ActivityTracking `json:"activity_tracking,omitempty"`

	// Enables sending metrics to IBM Cloud Monitoring. All metrics are sent to the IBM Cloud Monitoring instance defined
	// in the `monitoring_crn` field.
	MetricsMonitoring *MetricsMonitoring `json:"metrics_monitoring,omitempty"`

	// Maximum bytes for this bucket.
	HardQuota *int64 `json:"hard_quota,omitempty"`

	// Data structure holding protection management response.
	ProtectionManagement *ProtectionManagementResponse `json:"protection_management,omitempty"`
}

Bucket : A bucket.

type BucketPatch

type BucketPatch struct {
	// An access control mechanism based on the network (IP address) where request originated. Requests not originating
	// from IP addresses listed in the `allowed_ip` field will be denied regardless of any access policies (including
	// public access) that might otherwise permit the request.  Viewing or updating the `Firewall` element requires the
	// requester to have the `manager` role.
	Firewall *Firewall `json:"firewall,omitempty"`

	// Enables sending log data to IBM Cloud Activity Tracker to provide visibility into object read and write events. All
	// object events are sent to the activity tracker instance defined in the `activity_tracker_crn` field.
	ActivityTracking *ActivityTracking `json:"activity_tracking,omitempty"`

	// Enables sending metrics to IBM Cloud Monitoring. All metrics are sent to the IBM Cloud Monitoring instance defined
	// in the `monitoring_crn` field.
	MetricsMonitoring *MetricsMonitoring `json:"metrics_monitoring,omitempty"`

	// Maximum bytes for this bucket.
	HardQuota *int64 `json:"hard_quota,omitempty"`

	// Data structure holding protection management operations.
	ProtectionManagement *ProtectionManagement `json:"protection_management,omitempty"`
}

BucketPatch : An object containing new bucket metadata.

func (*BucketPatch) AsPatch

func (bucketPatch *BucketPatch) AsPatch() (_patch map[string]interface{}, err error)

AsPatch returns a generic map representation of the BucketPatch

type Firewall

type Firewall struct {
	// List of IPv4 or IPv6 addresses in CIDR notation to be affected by firewall in CIDR notation is supported. Passing an
	// empty array will lift the IP address filter.  The `allowed_ip` array can contain a maximum of 1000 items.
	AllowedIp []string `json:"allowed_ip"`
}

Firewall : An access control mechanism based on the network (IP address) where request originated. Requests not originating from IP addresses listed in the `allowed_ip` field will be denied regardless of any access policies (including public access) that might otherwise permit the request. Viewing or updating the `Firewall` element requires the requester to have the `manager` role.

type GetBucketConfigOptions

type GetBucketConfigOptions struct {
	// Name of a bucket.
	Bucket *string `json:"bucket" validate:"required,ne="`

	// Allows users to set headers on API requests
	Headers map[string]string
}

GetBucketConfigOptions : The GetBucketConfig options.

func (*GetBucketConfigOptions) SetBucket

func (_options *GetBucketConfigOptions) SetBucket(bucket string) *GetBucketConfigOptions

SetBucket : Allow user to set Bucket

func (*GetBucketConfigOptions) SetHeaders

func (options *GetBucketConfigOptions) SetHeaders(param map[string]string) *GetBucketConfigOptions

SetHeaders : Allow user to set Headers

type MetricsMonitoring

type MetricsMonitoring struct {
	// If set to `true`, all usage metrics (i.e. `bytes_used`) will be sent to the monitoring service.
	UsageMetricsEnabled *bool `json:"usage_metrics_enabled,omitempty"`

	// If set to `true`, all request metrics (i.e. `rest.object.head`) will be sent to the monitoring service.
	RequestMetricsEnabled *bool `json:"request_metrics_enabled,omitempty"`

	// Required the first time `metrics_monitoring` is configured. The instance of IBM Cloud Monitoring that will receive
	// the bucket metrics. The format is "crn:v1:bluemix:public:logdnaat:{bucket location}:a/{storage account}:{monitoring
	// service instance}::".
	MetricsMonitoringCrn *string `json:"metrics_monitoring_crn,omitempty"`
}

MetricsMonitoring : Enables sending metrics to IBM Cloud Monitoring. All metrics are sent to the IBM Cloud Monitoring instance defined in the `monitoring_crn` field.

type ProtectionManagement added in v2.0.4

type ProtectionManagement struct {
	// If set to `activate`, protection management action on the bucket is being activated.
	RequestedState *string `json:"requested_state,omitempty"`

	// This field is required when using requested_state\:`activate` and holds a JWT that is provided by the Cloud
	// Operator. This should be the encoded JWT.
	ProtectionManagementToken *string `json:"protection_management_token,omitempty"`
}

ProtectionManagement : Data structure holding protection management operations.

type ProtectionManagementResponse added in v2.0.4

type ProtectionManagementResponse struct {
	// Indicates the X number of protection management tokens that have been applied to the bucket in its lifetime.
	TokenAppliedCounter *string `json:"token_applied_counter,omitempty"`

	// The 'protection management token list' holding a recent list of applied tokens. This list may contain a subset of
	// all tokens applied to the bucket, as indicated by the counter.
	TokenEntries []ProtectionManagementResponseTokenEntry `json:"token_entries,omitempty"`
}

ProtectionManagementResponse : Data structure holding protection management response.

type ProtectionManagementResponseTokenEntry added in v2.0.4

type ProtectionManagementResponseTokenEntry struct {
	TokenID *string `json:"token_id,omitempty"`

	TokenExpirationTime *string `json:"token_expiration_time,omitempty"`

	TokenReferenceID *string `json:"token_reference_id,omitempty"`

	AppliedTime *string `json:"applied_time,omitempty"`

	InvalidatedTime *string `json:"invalidated_time,omitempty"`

	ExpirationTime *string `json:"expiration_time,omitempty"`

	ShortenRetentionFlag *bool `json:"shorten_retention_flag,omitempty"`
}

ProtectionManagementResponseTokenEntry : Data structure holding protection management token.

type ResourceConfigurationV1

type ResourceConfigurationV1 struct {
	Service *core.BaseService
}

ResourceConfigurationV1 : REST API used to configure Cloud Object Storage buckets.

API Version: 1.0.0

func NewResourceConfigurationV1

func NewResourceConfigurationV1(options *ResourceConfigurationV1Options) (service *ResourceConfigurationV1, err error)

NewResourceConfigurationV1 : constructs an instance of ResourceConfigurationV1 with passed in options.

func NewResourceConfigurationV1UsingExternalConfig

func NewResourceConfigurationV1UsingExternalConfig(options *ResourceConfigurationV1Options) (resourceConfiguration *ResourceConfigurationV1, err error)

NewResourceConfigurationV1UsingExternalConfig : constructs an instance of ResourceConfigurationV1 with passed in options and external configuration.

func (*ResourceConfigurationV1) Clone

func (resourceConfiguration *ResourceConfigurationV1) Clone() *ResourceConfigurationV1

Clone makes a copy of "resourceConfiguration" suitable for processing requests.

func (*ResourceConfigurationV1) DisableRetries

func (resourceConfiguration *ResourceConfigurationV1) DisableRetries()

DisableRetries disables automatic retries for requests invoked for this service instance.

func (*ResourceConfigurationV1) EnableRetries

func (resourceConfiguration *ResourceConfigurationV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration)

EnableRetries enables automatic retries for requests invoked for this service instance. If either parameter is specified as 0, then a default value is used instead.

func (*ResourceConfigurationV1) GetBucketConfig

func (resourceConfiguration *ResourceConfigurationV1) GetBucketConfig(getBucketConfigOptions *GetBucketConfigOptions) (result *Bucket, response *core.DetailedResponse, err error)

GetBucketConfig : Returns metadata for the specified bucket Returns metadata for the specified bucket.

func (*ResourceConfigurationV1) GetBucketConfigWithContext

func (resourceConfiguration *ResourceConfigurationV1) GetBucketConfigWithContext(ctx context.Context, getBucketConfigOptions *GetBucketConfigOptions) (result *Bucket, response *core.DetailedResponse, err error)

GetBucketConfigWithContext is an alternate form of the GetBucketConfig method which supports a Context parameter

func (*ResourceConfigurationV1) GetEnableGzipCompression

func (resourceConfiguration *ResourceConfigurationV1) GetEnableGzipCompression() bool

GetEnableGzipCompression returns the service's EnableGzipCompression field

func (*ResourceConfigurationV1) GetServiceURL

func (resourceConfiguration *ResourceConfigurationV1) GetServiceURL() string

GetServiceURL returns the service URL

func (*ResourceConfigurationV1) NewGetBucketConfigOptions

func (*ResourceConfigurationV1) NewGetBucketConfigOptions(bucket string) *GetBucketConfigOptions

NewGetBucketConfigOptions : Instantiate GetBucketConfigOptions

func (*ResourceConfigurationV1) NewUpdateBucketConfigOptions

func (*ResourceConfigurationV1) NewUpdateBucketConfigOptions(bucket string) *UpdateBucketConfigOptions

NewUpdateBucketConfigOptions : Instantiate UpdateBucketConfigOptions

func (*ResourceConfigurationV1) SetDefaultHeaders

func (resourceConfiguration *ResourceConfigurationV1) SetDefaultHeaders(headers http.Header)

SetDefaultHeaders sets HTTP headers to be sent in every request

func (*ResourceConfigurationV1) SetEnableGzipCompression

func (resourceConfiguration *ResourceConfigurationV1) SetEnableGzipCompression(enableGzip bool)

SetEnableGzipCompression sets the service's EnableGzipCompression field

func (*ResourceConfigurationV1) SetServiceURL

func (resourceConfiguration *ResourceConfigurationV1) SetServiceURL(url string) error

SetServiceURL sets the service URL

func (*ResourceConfigurationV1) UpdateBucketConfig

func (resourceConfiguration *ResourceConfigurationV1) UpdateBucketConfig(updateBucketConfigOptions *UpdateBucketConfigOptions) (response *core.DetailedResponse, err error)

UpdateBucketConfig : Make changes to a bucket's configuration Updates a bucket using [JSON Merge Patch](https://tools.ietf.org/html/rfc7396). This request is used to add functionality (like an IP access filter) or to update existing parameters. **Primitives are overwritten and replaced in their entirety. It is not possible to append a new (or to delete a specific) value to an array.** Arrays can be cleared by updating the parameter with an empty array `[]`. A `PATCH` operation only updates specified mutable fields. Please don't use `PATCH` trying to update the number of objects in a bucket, any timestamps, or other non-mutable fields.

func (*ResourceConfigurationV1) UpdateBucketConfigWithContext

func (resourceConfiguration *ResourceConfigurationV1) UpdateBucketConfigWithContext(ctx context.Context, updateBucketConfigOptions *UpdateBucketConfigOptions) (response *core.DetailedResponse, err error)

UpdateBucketConfigWithContext is an alternate form of the UpdateBucketConfig method which supports a Context parameter

type ResourceConfigurationV1Options

type ResourceConfigurationV1Options struct {
	ServiceName   string
	URL           string
	Authenticator core.Authenticator
}

ResourceConfigurationV1Options : Service options

type UpdateBucketConfigOptions

type UpdateBucketConfigOptions struct {
	// Name of a bucket.
	Bucket *string `json:"bucket" validate:"required,ne="`

	// An object containing new configuration metadata.
	BucketPatch map[string]interface{} `json:"Bucket_patch,omitempty"`

	// An Etag previously returned in a header when fetching or updating a bucket's metadata. If this value does not match
	// the active Etag, the request will fail.
	IfMatch *string `json:"if-match,omitempty"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

UpdateBucketConfigOptions : The UpdateBucketConfig options.

func (*UpdateBucketConfigOptions) SetBucket

func (_options *UpdateBucketConfigOptions) SetBucket(bucket string) *UpdateBucketConfigOptions

SetBucket : Allow user to set Bucket

func (*UpdateBucketConfigOptions) SetBucketPatch

func (_options *UpdateBucketConfigOptions) SetBucketPatch(bucketPatch map[string]interface{}) *UpdateBucketConfigOptions

SetBucketPatch : Allow user to set BucketPatch

func (*UpdateBucketConfigOptions) SetHeaders

func (options *UpdateBucketConfigOptions) SetHeaders(param map[string]string) *UpdateBucketConfigOptions

SetHeaders : Allow user to set Headers

func (*UpdateBucketConfigOptions) SetIfMatch

func (_options *UpdateBucketConfigOptions) SetIfMatch(ifMatch string) *UpdateBucketConfigOptions

SetIfMatch : Allow user to set IfMatch

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL