 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package subscriptions allows CRUD operations on the Subscriptions resource.
Index ¶
- Constants
- type API
- func (a *API) Create(ctx context.Context, subscription CreateSubscription) (int, error)
- func (a *API) CreateActiveActiveVPCPeering(ctx context.Context, id int, create CreateActiveActiveVPCPeering) (int, error)
- func (a *API) CreateVPCPeering(ctx context.Context, id int, create CreateVPCPeering) (int, error)
- func (a *API) Delete(ctx context.Context, id int) error
- func (a *API) DeleteActiveActiveVPCPeering(ctx context.Context, subscription int, peering int) error
- func (a *API) DeleteVPCPeering(ctx context.Context, subscription int, peering int) error
- func (a *API) Get(ctx context.Context, id int) (*Subscription, error)
- func (a *API) GetCIDRAllowlist(ctx context.Context, id int) (*CIDRAllowlist, error)
- func (a API) List(ctx context.Context) ([]*Subscription, error)
- func (a *API) ListActiveActiveRegions(ctx context.Context, subscription int) ([]*ActiveActiveRegion, error)
- func (a *API) ListActiveActiveVPCPeering(ctx context.Context, id int) ([]*ActiveActiveVpcRegion, error)
- func (a *API) ListVPCPeering(ctx context.Context, id int) ([]*VPCPeering, error)
- func (a *API) Update(ctx context.Context, id int, subscription UpdateSubscription) error
- func (a *API) UpdateCIDRAllowlist(ctx context.Context, id int, cidr UpdateCIDRAllowlist) error
 
- type ActiveActiveDatabase
- type ActiveActiveRegion
- type ActiveActiveVPCPeering
- type ActiveActiveVpcRegion
- type CIDR
- type CIDRAllowlist
- type CloudDetail
- type CreateActiveActiveVPCPeering
- type CreateCloudProvider
- type CreateDatabase
- type CreateLocalThroughput
- type CreateModules
- type CreateNetworking
- type CreateRegion
- type CreateSubscription
- type CreateThroughput
- type CreateVPCPeering
- type HttpClient
- type ListSubscriptionRegionsResponse
- type Log
- type Networking
- type NotFound
- type Region
- type Subscription
- type TaskWaiter
- type UpdateCIDRAllowlist
- type UpdateSubscription
- type VPCPeering
Constants ¶
const ( // SubscriptionStatusActive is the active value of the `Status` field in `Subscription` SubscriptionStatusActive = "active" // SubscriptionStatusPending is the pending value of the `Status` field in `Subscription` SubscriptionStatusPending = "pending" // SubscriptionStatusError is the error value of the `Status` field in `Subscription` SubscriptionStatusError = "error" // SubscriptionStatusDeleting is the deleting value of the `Status` field in `Subscription` SubscriptionStatusDeleting = "deleting" // VPCPeeringStatusInitiatingRequest is the initiating request value of the `Status` field in `VPCPeering` VPCPeeringStatusInitiatingRequest = "initiating-request" // VPCPeeringStatusActive is the active value of the `Status` field in `VPCPeering` VPCPeeringStatusActive = "active" // VPCPeeringStatusInactive is the inactive value of the `Status` field in `VPCPeering` VPCPeeringStatusInactive = "inactive" // VPCPeeringStatusPendingAcceptance is the pending acceptance value of the `Status` field in `VPCPeering` VPCPeeringStatusPendingAcceptance = "pending-acceptance" // VPCPeeringStatusFailed is the failed value of the `Status` field in `VPCPeering` VPCPeeringStatusFailed = "failed" SubscriptionDeploymentTypeSingleRegion = "single-region" SubscriptionDeploymentTypeActiveActive = "active-active" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
	// contains filtered or unexported fields
}
    func NewAPI ¶
func NewAPI(client HttpClient, taskWaiter TaskWaiter, logger Log) *API
func (*API) CreateActiveActiveVPCPeering ¶ added in v0.1.10
func (*API) CreateVPCPeering ¶
CreateVPCPeering creates a new VPC peering from the subscription VPC and returns the identifier of the VPC peering.
func (*API) Delete ¶
Delete will destroy an existing subscription. All existing databases within the subscription should already be deleted, otherwise this function will fail.
func (*API) DeleteActiveActiveVPCPeering ¶ added in v0.1.13
func (*API) DeleteVPCPeering ¶
DeleteVPCPeering destroys an existing VPC peering connection.
func (*API) GetCIDRAllowlist ¶
GetCIDRAllowlist retrieves the CIDR addresses that are allowed to access an endpoint for a database associated with a the subscription.
func (API) List ¶
func (a API) List(ctx context.Context) ([]*Subscription, error)
List will list all of the current account's subscriptions.
func (*API) ListActiveActiveRegions ¶ added in v0.24.0
func (*API) ListActiveActiveVPCPeering ¶ added in v0.1.13
func (*API) ListVPCPeering ¶
ListVPCPeering retrieves the VPCs that have been peered to the subscription VPC.
func (*API) UpdateCIDRAllowlist ¶
UpdateCIDRAllowlist modifies the CIDR addresses that are allowed to access an endpoint for a database associated with a the subscription.
type ActiveActiveDatabase ¶ added in v0.24.0
type ActiveActiveRegion ¶ added in v0.24.0
type ActiveActiveRegion struct {
	RegionId       *int                   `json:"regionId,omitempty"`
	Region         *string                `json:"region,omitempty"`
	DeploymentCIDR *string                `json:"deploymentCIDR,omitempty"`
	VpcId          *string                `json:"vpcId,omitempty"`
	Databases      []ActiveActiveDatabase `json:"databases,omitempty"`
}
    have to redeclare these here (copied from regions model) to avoid an import cycle
type ActiveActiveVPCPeering ¶ added in v0.1.13
type ActiveActiveVPCPeering struct {
	ID                *int    `json:"id,omitempty"`
	Status            *string `json:"status,omitempty"`
	RegionId          *int    `json:"regionId,omitempty"`
	RegionName        *string `json:"regionName,omitempty"`
	AWSAccountID      *string `json:"awsAccountId,omitempty"`
	AWSPeeringID      *string `json:"awsPeeringUid,omitempty"`
	VPCId             *string `json:"vpcUid,omitempty"`
	VPCCidr           *string `json:"vpcCidr,omitempty"`
	VPCCidrs          []*CIDR `json:"vpcCidrs,omitempty"`
	GCPProjectUID     *string `json:"vpcProjectUid,omitempty"`
	NetworkName       *string `json:"vpcNetworkName,omitempty"`
	RedisProjectUID   *string `json:"redisProjectUid,omitempty"`
	RedisNetworkName  *string `json:"redisNetworkName,omitempty"`
	CloudPeeringID    *string `json:"cloudPeeringId,omitempty"`
	SourceRegion      *string `json:"sourceRegion,omitempty"`
	DestinationRegion *string `json:"destinationRegion,omitempty"`
}
    func (ActiveActiveVPCPeering) String ¶ added in v0.1.13
func (o ActiveActiveVPCPeering) String() string
type ActiveActiveVpcRegion ¶ added in v0.1.13
type ActiveActiveVpcRegion struct {
	ID           *int                      `json:"id,omitempty"`
	SourceRegion *string                   `json:"region,omitempty"`
	VPCPeerings  []*ActiveActiveVPCPeering `json:"vpcPeerings,omitempty"`
}
    type CIDR ¶ added in v0.3.0
type CIDRAllowlist ¶
type CIDRAllowlist struct {
	CIDRIPs          []*string   `json:"cidr_ips,omitempty"`
	SecurityGroupIDs []*string   `json:"security_group_ids,omitempty"`
	Errors           interface{} `json:"errors,omitempty"`
}
    func (CIDRAllowlist) String ¶
func (o CIDRAllowlist) String() string
type CloudDetail ¶
type CloudDetail struct {
	Provider       *string   `json:"provider,omitempty"`
	CloudAccountID *int      `json:"cloudAccountId,omitempty"`
	TotalSizeInGB  *float64  `json:"totalSizeInGb,omitempty"`
	Regions        []*Region `json:"regions,omitempty"`
}
    func (CloudDetail) String ¶
func (o CloudDetail) String() string
type CreateActiveActiveVPCPeering ¶ added in v0.1.13
type CreateActiveActiveVPCPeering struct {
	SourceRegion      *string   `json:"sourceRegion,omitempty"`
	DestinationRegion *string   `json:"destinationRegion,omitempty"`
	AWSAccountID      *string   `json:"awsAccountId,omitempty"`
	VPCId             *string   `json:"vpcId,omitempty"`
	VPCCidr           *string   `json:"vpcCidr,omitempty"`
	VPCCidrs          []*string `json:"vpcCidrs,omitempty"`
	Provider          *string   `json:"provider,omitempty"`
	VPCProjectUID     *string   `json:"vpcProjectUid,omitempty"`
	VPCNetworkName    *string   `json:"vpcNetworkName,omitempty"`
}
    func (CreateActiveActiveVPCPeering) String ¶ added in v0.1.13
func (o CreateActiveActiveVPCPeering) String() string
type CreateCloudProvider ¶
type CreateCloudProvider struct {
	Provider       *string         `json:"provider,omitempty"`
	CloudAccountID *int            `json:"cloudAccountId,omitempty"`
	Regions        []*CreateRegion `json:"regions,omitempty"`
}
    func (CreateCloudProvider) String ¶
func (o CreateCloudProvider) String() string
type CreateDatabase ¶
type CreateDatabase struct {
	Name                       *string                  `json:"name,omitempty"`
	Protocol                   *string                  `json:"protocol,omitempty"`
	MemoryLimitInGB            *float64                 `json:"memoryLimitInGb,omitempty"`
	DatasetSizeInGB            *float64                 `json:"datasetSizeInGb,omitempty"`
	SupportOSSClusterAPI       *bool                    `json:"supportOSSClusterApi,omitempty"`
	DataPersistence            *string                  `json:"dataPersistence,omitempty"`
	Replication                *bool                    `json:"replication,omitempty"`
	ThroughputMeasurement      *CreateThroughput        `json:"throughputMeasurement,omitempty"`
	LocalThroughputMeasurement []*CreateLocalThroughput `json:"localThroughputMeasurement,omitempty"`
	Modules                    []*CreateModules         `json:"modules,omitempty"`
	Quantity                   *int                     `json:"quantity,omitempty"`
	AverageItemSizeInBytes     *int                     `json:"averageItemSizeInBytes,omitempty"`
	QueryPerformanceFactor     *string                  `json:"queryPerformanceFactor,omitempty"`
}
    func (CreateDatabase) String ¶
func (o CreateDatabase) String() string
type CreateLocalThroughput ¶ added in v0.1.10
type CreateLocalThroughput struct {
	Region                   *string `json:"region,omitempty"`
	WriteOperationsPerSecond *int    `json:"writeOperationsPerSecond"`
	ReadOperationsPerSecond  *int    `json:"readOperationsPerSecond"`
}
    func (CreateLocalThroughput) String ¶ added in v0.1.10
func (o CreateLocalThroughput) String() string
type CreateModules ¶
type CreateModules struct {
	Name *string `json:"name,omitempty"`
}
    func (CreateModules) String ¶
func (o CreateModules) String() string
type CreateNetworking ¶
type CreateNetworking struct {
	DeploymentCIDR *string `json:"deploymentCIDR,omitempty"`
	VPCId          *string `json:"vpcId,omitempty"`
}
    func (CreateNetworking) String ¶
func (o CreateNetworking) String() string
type CreateRegion ¶
type CreateRegion struct {
	Region                     *string           `json:"region,omitempty"`
	MultipleAvailabilityZones  *bool             `json:"multipleAvailabilityZones,omitempty"`
	PreferredAvailabilityZones []*string         `json:"preferredAvailabilityZones,omitempty"`
	Networking                 *CreateNetworking `json:"networking,omitempty"`
}
    func (CreateRegion) String ¶
func (o CreateRegion) String() string
type CreateSubscription ¶
type CreateSubscription struct {
	Name            *string                `json:"name,omitempty"`
	DeploymentType  *string                `json:"deploymentType,omitempty"`
	DryRun          *bool                  `json:"dryRun,omitempty"`
	PaymentMethodID *int                   `json:"paymentMethodId,omitempty"`
	PaymentMethod   *string                `json:"paymentMethod,omitempty"`
	MemoryStorage   *string                `json:"memoryStorage,omitempty"`
	CloudProviders  []*CreateCloudProvider `json:"cloudProviders,omitempty"`
	Databases       []*CreateDatabase      `json:"databases,omitempty"`
	RedisVersion    *string                `json:"redisVersion,omitempty"`
}
    func (CreateSubscription) String ¶
func (o CreateSubscription) String() string
type CreateThroughput ¶
type CreateThroughput struct {
	By    *string `json:"by,omitempty"`
	Value *int    `json:"value,omitempty"`
}
    func (CreateThroughput) String ¶
func (o CreateThroughput) String() string
type CreateVPCPeering ¶
type CreateVPCPeering struct {
	Region         *string   `json:"region,omitempty"`
	AWSAccountID   *string   `json:"awsAccountId,omitempty"`
	VPCId          *string   `json:"vpcId,omitempty"`
	VPCCidr        *string   `json:"vpcCidr,omitempty"`
	VPCCidrs       []*string `json:"vpcCidrs,omitempty"`
	Provider       *string   `json:"provider,omitempty"`
	VPCProjectUID  *string   `json:"vpcProjectUid,omitempty"`
	VPCNetworkName *string   `json:"vpcNetworkName,omitempty"`
}
    func (CreateVPCPeering) String ¶
func (o CreateVPCPeering) String() string
type HttpClient ¶
type HttpClient interface {
	Get(ctx context.Context, name, path string, responseBody interface{}) error
	Post(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
	Put(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
	Delete(ctx context.Context, name, path string, responseBody interface{}) error
}
    type ListSubscriptionRegionsResponse ¶ added in v0.24.0
type ListSubscriptionRegionsResponse struct {
	SubscriptionId *int                  `json:"subscriptionId,omitempty"`
	Regions        []*ActiveActiveRegion `json:"regions"`
}
    type Networking ¶
type Networking struct {
	DeploymentCIDR *string `json:"deploymentCIDR,omitempty"`
	VPCId          *string `json:"vpcId,omitempty"`
	SubnetID       *string `json:"subnetId,omitempty"`
}
    func (Networking) String ¶
func (o Networking) String() string
type Region ¶
type Region struct {
	Region                     *string       `json:"region,omitempty"`
	Networking                 []*Networking `json:"networking,omitempty"`
	PreferredAvailabilityZones []*string     `json:"preferredAvailabilityZones,omitempty"`
	MultipleAvailabilityZones  *bool         `json:"multipleAvailabilityZones,omitempty"`
}
    type Subscription ¶
type Subscription struct {
	ID                *int           `json:"id,omitempty"`
	Name              *string        `json:"name,omitempty"`
	Status            *string        `json:"status,omitempty"`
	DeploymentType    *string        `json:"deploymentType,omitempty"`
	PaymentMethod     *string        `json:"paymentMethodType,omitempty"`
	PaymentMethodID   *int           `json:"paymentMethodId,omitempty"`
	MemoryStorage     *string        `json:"memoryStorage,omitempty"`
	StorageEncryption *bool          `json:"storageEncryption,omitempty"`
	NumberOfDatabases *int           `json:"numberOfDatabases,omitempty"`
	CloudDetails      []*CloudDetail `json:"cloudDetails,omitempty"`
}
    func (Subscription) String ¶
func (o Subscription) String() string
type TaskWaiter ¶ added in v0.9.0
type UpdateCIDRAllowlist ¶
type UpdateCIDRAllowlist struct {
	CIDRIPs          []*string `json:"cidrIps,omitempty"`
	SecurityGroupIDs []*string `json:"securityGroupIds,omitempty"`
}
    func (UpdateCIDRAllowlist) String ¶
func (o UpdateCIDRAllowlist) String() string
type UpdateSubscription ¶
type UpdateSubscription struct {
	Name            *string `json:"name,omitempty"`
	PaymentMethodID *int    `json:"paymentMethodId,omitempty"`
}
    func (UpdateSubscription) String ¶
func (o UpdateSubscription) String() string
type VPCPeering ¶
type VPCPeering struct {
	ID               *int    `json:"vpcPeeringId,omitempty"`
	Status           *string `json:"status,omitempty"`
	AWSAccountID     *string `json:"awsAccountId,omitempty"`
	AWSPeeringID     *string `json:"awsPeeringUid,omitempty"`
	VPCId            *string `json:"vpcUid,omitempty"`
	VPCCidr          *string `json:"vpcCidr,omitempty"`
	VPCCidrs         []*CIDR `json:"vpcCidrs,omitempty"`
	GCPProjectUID    *string `json:"projectUid,omitempty"`
	NetworkName      *string `json:"networkName,omitempty"`
	RedisProjectUID  *string `json:"redisProjectUid,omitempty"`
	RedisNetworkName *string `json:"redisNetworkName,omitempty"`
	CloudPeeringID   *string `json:"cloudPeeringId,omitempty"`
	Region           *string `json:"regionName,omitempty"`
}
    func (VPCPeering) String ¶
func (o VPCPeering) String() string