v1

package
v0.77.7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Overview

Package replication/v1 contains the API of replication services.

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (

	// EventTypeDeploymentReplicationCreated is the type of event fired after a DeploymentReplication has been created.
	// SubjectID contains the Deployment ID of the DeploymentReplication.
	EventTypeDeploymentReplicationCreated = "replication.deploymentreplication.created"
	// EventTypeDeploymentReplicationUpdated is the type of event fired after a DeploymentReplication has been updated.
	// SubjectID contains the Deployment ID of the DeploymentReplication.
	EventTypeDeploymentReplicationUpdated = "replication.deploymentreplication.updated"
	// EventTypeDeploymentReplicationDeleted is the type of event fired after a DeploymentReplication has been deleted.
	// SubjectID contains the Deployment ID of the DeploymentReplication.
	EventTypeDeploymentReplicationDeleted = "replication.deploymentreplication.deleted"
)
View Source
const (

	// PermissionGetDeploymentReplication is needed to get a DeploymentReplication for a given Deployment
	PermissionGetDeploymentReplication = "replication.deploymentreplication.get"

	// PermissionUpdateDeploymentReplication is needed to update / create a DeploymentReplication
	PermissionUpdateDeploymentReplication = "replication.deploymentreplication.update"
)
View Source
const (
	// APIID contains identifier of this API
	APIID = "replication/v1"
	// APIMajorVersion contains major version of this API
	APIMajorVersion = 1
	// APIMinorVersion contains minor version of this API
	APIMinorVersion = 1
	// APIPatchVersion contains patch version of this API
	APIPatchVersion = 2
)
View Source
const (

	// PermissionDeploymentCloneFromBackup is needed to clone a deployment from an existing backup.
	PermissionDeploymentCloneFromBackup = "replication.deployment.clone-from-backup"
)

Variables

View Source
var (
	ErrInvalidLengthReplication        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowReplication          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupReplication = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// Replication has started, waiting for sync masters / workers.
	DeploymentReplicationPhaseInitialising = "Initialising"
	// Replication has started and currently in progress.
	DeploymentReplicationPhaseInProgress = "In-Progress"
	// Replication is in an errored state.
	DeploymentReplicationPhaseError = "Error"
	// Replication could not complete successfully.
	DeploymentReplicationPhaseFailed = "Failed"
	// Replication is being stopped.
	DeploymentReplicationPhaseStopping = "Stopping"
	// Replication is stopped and all resources cleaned up properly.
	DeploymentReplicationPhaseCompleted = "Completed"
)

Functions

func RegisterReplicationServiceHandler

func RegisterReplicationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterReplicationServiceHandler registers the http handlers for service ReplicationService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterReplicationServiceHandlerClient

func RegisterReplicationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReplicationServiceClient) error

RegisterReplicationServiceHandlerClient registers the http handlers for service ReplicationService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ReplicationServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ReplicationServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ReplicationServiceClient" to call the correct interceptors.

func RegisterReplicationServiceHandlerFromEndpoint

func RegisterReplicationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterReplicationServiceHandlerFromEndpoint is same as RegisterReplicationServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterReplicationServiceHandlerServer

func RegisterReplicationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReplicationServiceServer) error

RegisterReplicationServiceHandlerServer registers the http handlers for service ReplicationService to "mux". UnaryRPC :call ReplicationServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterReplicationServiceServer

func RegisterReplicationServiceServer(s *grpc.Server, srv ReplicationServiceServer)

Types

type CloneDeploymentFromBackupRequest

type CloneDeploymentFromBackupRequest struct {
	// The ID of the backup to clone a deployment from.
	BackupId string `protobuf:"bytes,1,opt,name=backup_id,json=backupId,proto3" json:"backup_id,omitempty"`
	// Target region.
	// This is an optional field
	RegionId string `protobuf:"bytes,2,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"`
	// This field must be set to the identifier of the current Terms&Conditions
	// when cloning a deployment.
	// If the tier of the organization does not require a non-empty Terms&Condition
	// identifier, this field may be left empty.
	// If this field is not set the terms and conditions of the source deployment will be used.
	AcceptedTermsAndConditionsId string `` /* 151-byte string literal not displayed */
	// Target project identifier.
	// This is an optional field
	ProjectId            string   `protobuf:"bytes,4,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

CloneDeploymentFromBackupRequest defines a request object for clone deployment call.

func (*CloneDeploymentFromBackupRequest) Descriptor

func (*CloneDeploymentFromBackupRequest) Descriptor() ([]byte, []int)

func (*CloneDeploymentFromBackupRequest) GetAcceptedTermsAndConditionsId added in v0.50.3

func (m *CloneDeploymentFromBackupRequest) GetAcceptedTermsAndConditionsId() string

func (*CloneDeploymentFromBackupRequest) GetBackupId

func (m *CloneDeploymentFromBackupRequest) GetBackupId() string

func (*CloneDeploymentFromBackupRequest) GetProjectId added in v0.73.12

func (m *CloneDeploymentFromBackupRequest) GetProjectId() string

func (*CloneDeploymentFromBackupRequest) GetRegionId

func (m *CloneDeploymentFromBackupRequest) GetRegionId() string

func (*CloneDeploymentFromBackupRequest) Marshal

func (m *CloneDeploymentFromBackupRequest) Marshal() (dAtA []byte, err error)

func (*CloneDeploymentFromBackupRequest) MarshalTo

func (m *CloneDeploymentFromBackupRequest) MarshalTo(dAtA []byte) (int, error)

func (*CloneDeploymentFromBackupRequest) MarshalToSizedBuffer

func (m *CloneDeploymentFromBackupRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CloneDeploymentFromBackupRequest) ProtoMessage

func (*CloneDeploymentFromBackupRequest) ProtoMessage()

func (*CloneDeploymentFromBackupRequest) Reset

func (*CloneDeploymentFromBackupRequest) Size

func (m *CloneDeploymentFromBackupRequest) Size() (n int)

func (*CloneDeploymentFromBackupRequest) String

func (*CloneDeploymentFromBackupRequest) Unmarshal

func (m *CloneDeploymentFromBackupRequest) Unmarshal(dAtA []byte) error

func (*CloneDeploymentFromBackupRequest) XXX_DiscardUnknown

func (m *CloneDeploymentFromBackupRequest) XXX_DiscardUnknown()

func (*CloneDeploymentFromBackupRequest) XXX_Marshal

func (m *CloneDeploymentFromBackupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CloneDeploymentFromBackupRequest) XXX_Merge

func (*CloneDeploymentFromBackupRequest) XXX_Size

func (m *CloneDeploymentFromBackupRequest) XXX_Size() int

func (*CloneDeploymentFromBackupRequest) XXX_Unmarshal

func (m *CloneDeploymentFromBackupRequest) XXX_Unmarshal(b []byte) error

type DeploymentReplication added in v0.75.0

type DeploymentReplication struct {
	// Identifier of the deployments for a given DeploymentReplication
	DeploymentId string `protobuf:"bytes,1,opt,name=deployment_id,json=deploymentId,proto3" json:"deployment_id,omitempty"`
	// Start the replication process for a given deployment.
	Started bool `protobuf:"varint,2,opt,name=started,proto3" json:"started,omitempty"`
	// A PEM encoded representation of the public key of the CA certificate used to verify sync master in source datacenter.
	CertificatePem string `protobuf:"bytes,3,opt,name=certificate_pem,json=certificatePem,proto3" json:"certificate_pem,omitempty"`
	// A PEM encoded representation of the keyfile used for client authentication of the sync master (with the sync master in the source datacenter).
	// A keyfile contains 1 or more certificates and a private key.
	TlsKeyfile string `protobuf:"bytes,4,opt,name=tls_keyfile,json=tlsKeyfile,proto3" json:"tls_keyfile,omitempty"`
	// List of master endpoints at source data center.
	MasterEndpoint []string `protobuf:"bytes,5,rep,name=master_endpoint,json=masterEndpoint,proto3" json:"master_endpoint,omitempty"`
	// Status of the DeploymentReplication.
	Status               *DeploymentReplication_Status `protobuf:"bytes,100,opt,name=status,proto3" json:"status,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

DeploymentReplication defines a request object for creating or updating a deployment replication

func (*DeploymentReplication) Descriptor added in v0.75.0

func (*DeploymentReplication) Descriptor() ([]byte, []int)

func (*DeploymentReplication) GetCertificatePem added in v0.75.0

func (m *DeploymentReplication) GetCertificatePem() string

func (*DeploymentReplication) GetDeploymentId added in v0.75.0

func (m *DeploymentReplication) GetDeploymentId() string

func (*DeploymentReplication) GetMasterEndpoint added in v0.75.0

func (m *DeploymentReplication) GetMasterEndpoint() []string

func (*DeploymentReplication) GetStarted added in v0.75.0

func (m *DeploymentReplication) GetStarted() bool

func (*DeploymentReplication) GetStatus added in v0.75.0

func (*DeploymentReplication) GetTlsKeyfile added in v0.75.0

func (m *DeploymentReplication) GetTlsKeyfile() string

func (*DeploymentReplication) Marshal added in v0.75.0

func (m *DeploymentReplication) Marshal() (dAtA []byte, err error)

func (*DeploymentReplication) MarshalTo added in v0.75.0

func (m *DeploymentReplication) MarshalTo(dAtA []byte) (int, error)

func (*DeploymentReplication) MarshalToSizedBuffer added in v0.75.0

func (m *DeploymentReplication) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DeploymentReplication) ProtoMessage added in v0.75.0

func (*DeploymentReplication) ProtoMessage()

func (*DeploymentReplication) Reset added in v0.75.0

func (m *DeploymentReplication) Reset()

func (*DeploymentReplication) Size added in v0.75.0

func (m *DeploymentReplication) Size() (n int)

func (*DeploymentReplication) String added in v0.75.0

func (m *DeploymentReplication) String() string

func (*DeploymentReplication) Unmarshal added in v0.75.0

func (m *DeploymentReplication) Unmarshal(dAtA []byte) error

func (*DeploymentReplication) XXX_DiscardUnknown added in v0.75.0

func (m *DeploymentReplication) XXX_DiscardUnknown()

func (*DeploymentReplication) XXX_Marshal added in v0.75.0

func (m *DeploymentReplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeploymentReplication) XXX_Merge added in v0.75.0

func (m *DeploymentReplication) XXX_Merge(src proto.Message)

func (*DeploymentReplication) XXX_Size added in v0.75.0

func (m *DeploymentReplication) XXX_Size() int

func (*DeploymentReplication) XXX_Unmarshal added in v0.75.0

func (m *DeploymentReplication) XXX_Unmarshal(b []byte) error

type DeploymentReplication_Status added in v0.75.0

type DeploymentReplication_Status struct {
	// Where the deployment replication process is in its lifecycle at any given time.
	// Should only contain only one of the following values:
	// "Initialising"   - Replication has started, waiting for sync masters / workers.
	// "In-Progress"    - Replication has started and currently in progress.
	// "Error"          - Replication is in an errored state.
	// "Failed"         - Replication could not complete successfully.
	// "Stopping"       - Replication is being stopped.
	// "Completed"      - Replication is stopped and all resources cleaned up properly.
	Phase string `protobuf:"bytes,1,opt,name=phase,proto3" json:"phase,omitempty"`
	// Supporting information about the deployment replication phase - such as error messages in case of failures.
	// This field will be in JSON format and can be built using the `AsJSON()` helper.
	// Use `FromJSON()` helper to parse this field.
	// See - replication/v1/message.go in this repository.
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// Total number of shards that should be in-sync.
	TotalShards int32 `protobuf:"varint,3,opt,name=total_shards,json=totalShards,proto3" json:"total_shards,omitempty"`
	// Number of shards currently in-sync.
	ShardsInSync int32 `protobuf:"varint,4,opt,name=shards_in_sync,json=shardsInSync,proto3" json:"shards_in_sync,omitempty"`
	// Service (LoadBalancer) endpoint of the SyncMasters
	// This field has the format of a URL.
	// This is a readonly field.
	SyncEndpoint string `protobuf:"bytes,5,opt,name=sync_endpoint,json=syncEndpoint,proto3" json:"sync_endpoint,omitempty"`
	// The timestamp of when the Phase of the Deployment Replication was last updated.
	// This is a readonly field.
	PhaseUpdatedAt       *types.Timestamp `protobuf:"bytes,6,opt,name=phase_updated_at,json=phaseUpdatedAt,proto3" json:"phase_updated_at,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

DeploymentReplicationStatus defines the status of a deployment replication. Note: All fields in this message block are read-only.

func (*DeploymentReplication_Status) Descriptor added in v0.75.0

func (*DeploymentReplication_Status) Descriptor() ([]byte, []int)

func (*DeploymentReplication_Status) Equals added in v0.75.1

Equals returns true when source and other have the same values.

func (*DeploymentReplication_Status) GetMessage added in v0.75.0

func (m *DeploymentReplication_Status) GetMessage() string

func (*DeploymentReplication_Status) GetPhase added in v0.75.0

func (m *DeploymentReplication_Status) GetPhase() string

func (*DeploymentReplication_Status) GetPhaseUpdatedAt added in v0.76.3

func (m *DeploymentReplication_Status) GetPhaseUpdatedAt() *types.Timestamp

func (*DeploymentReplication_Status) GetShardsInSync added in v0.75.0

func (m *DeploymentReplication_Status) GetShardsInSync() int32

func (*DeploymentReplication_Status) GetSyncEndpoint added in v0.75.0

func (m *DeploymentReplication_Status) GetSyncEndpoint() string

func (*DeploymentReplication_Status) GetTotalShards added in v0.75.0

func (m *DeploymentReplication_Status) GetTotalShards() int32

func (*DeploymentReplication_Status) Marshal added in v0.75.0

func (m *DeploymentReplication_Status) Marshal() (dAtA []byte, err error)

func (*DeploymentReplication_Status) MarshalTo added in v0.75.0

func (m *DeploymentReplication_Status) MarshalTo(dAtA []byte) (int, error)

func (*DeploymentReplication_Status) MarshalToSizedBuffer added in v0.75.0

func (m *DeploymentReplication_Status) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DeploymentReplication_Status) ProtoMessage added in v0.75.0

func (*DeploymentReplication_Status) ProtoMessage()

func (*DeploymentReplication_Status) Reset added in v0.75.0

func (m *DeploymentReplication_Status) Reset()

func (*DeploymentReplication_Status) Size added in v0.75.0

func (m *DeploymentReplication_Status) Size() (n int)

func (*DeploymentReplication_Status) String added in v0.75.0

func (*DeploymentReplication_Status) Unmarshal added in v0.75.0

func (m *DeploymentReplication_Status) Unmarshal(dAtA []byte) error

func (*DeploymentReplication_Status) XXX_DiscardUnknown added in v0.75.0

func (m *DeploymentReplication_Status) XXX_DiscardUnknown()

func (*DeploymentReplication_Status) XXX_Marshal added in v0.75.0

func (m *DeploymentReplication_Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeploymentReplication_Status) XXX_Merge added in v0.75.0

func (m *DeploymentReplication_Status) XXX_Merge(src proto.Message)

func (*DeploymentReplication_Status) XXX_Size added in v0.75.0

func (m *DeploymentReplication_Status) XXX_Size() int

func (*DeploymentReplication_Status) XXX_Unmarshal added in v0.75.0

func (m *DeploymentReplication_Status) XXX_Unmarshal(b []byte) error

type Message added in v0.76.1

type Message struct {
	// Reason contains information related to the current state of the migration process
	// or any supporting information related to failures.
	Reason string `json:"reason,omitempty"`
	// DbErrors contains information related to database errors that could occur during the migration process.
	DbErrors string `json:"db_errors,omitempty"`
	// SyncErrors contains information related to errors from the ArangoSync component.
	SyncErrors string `json:"sync_errors,omitempty"`
}

Message holds any additional information that the user must know regarding the replication / migration process.

func NewMessage added in v0.76.1

func NewMessage(reason, dbErrors, syncErrors string) Message

NewMessage returns a new Message type with the given reason, dbErrors and syncErrors strings.

func (Message) AsJSON added in v0.76.1

func (m Message) AsJSON() string

AsJSON returns a JSON representation of the `Message` struct.

func (*Message) FromJSON added in v0.76.1

func (m *Message) FromJSON(msg string) error

FromJSON converts a JSON string representation of `Message`, and decodes it into a `*Message` type.

type ReplicationServiceClient

type ReplicationServiceClient interface {
	// Get the current API version of this service.
	// Required permissions:
	// - None
	GetAPIVersion(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Version, error)
	// Takes a backup and creates a deployment from it. For all intents and purposes this new deployment
	// will be the same as the deployment at that exact moment when the backup was taken from it. This means that
	// the new deployment will be in the same project and use the same provider as the old deployment did. Optionally
	// a different region can be provided using the region id field on the request. Furthermore, the new deployment
	// will have the same server settings ( count, mode, replication factor ) as the old deployment did at the time
	// of taking the backup. After the new deployment successfully started, the backup will be used to restore the
	// data into the new deployment. The new deployment will have a different endpoint, and the password will also
	// be reset for it. All other user settings will remain the same.
	// The old deployment will not be touched.
	// Required permissions:
	// if project_id is specified
	// - backup.backup.get on the backup specified by backup_id in request
	// - replication.deployment.clone-from-backup on the project specified in request
	// if project_id is not specified
	// - replication.deployment.clone-from-backup on the backup specified by backup_id
	CloneDeploymentFromBackup(ctx context.Context, in *CloneDeploymentFromBackupRequest, opts ...grpc.CallOption) (*v11.Deployment, error)
	// Get an existing DeploymentReplication using its deployment ID
	// Required permissions:
	// - replication.deploymentreplication.get
	GetDeploymentReplication(ctx context.Context, in *v1.IDOptions, opts ...grpc.CallOption) (*DeploymentReplication, error)
	// Update an existing DeploymentReplication spec. If does not exist, this will create a new one.
	// This call expects the complete entity with the updated fields.
	// Required permissions:
	// - replication.deploymentreplication.update
	UpdateDeploymentReplication(ctx context.Context, in *DeploymentReplication, opts ...grpc.CallOption) (*DeploymentReplication, error)
}

ReplicationServiceClient is the client API for ReplicationService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewReplicationServiceClient

func NewReplicationServiceClient(cc *grpc.ClientConn) ReplicationServiceClient

type ReplicationServiceServer

type ReplicationServiceServer interface {
	// Get the current API version of this service.
	// Required permissions:
	// - None
	GetAPIVersion(context.Context, *v1.Empty) (*v1.Version, error)
	// Takes a backup and creates a deployment from it. For all intents and purposes this new deployment
	// will be the same as the deployment at that exact moment when the backup was taken from it. This means that
	// the new deployment will be in the same project and use the same provider as the old deployment did. Optionally
	// a different region can be provided using the region id field on the request. Furthermore, the new deployment
	// will have the same server settings ( count, mode, replication factor ) as the old deployment did at the time
	// of taking the backup. After the new deployment successfully started, the backup will be used to restore the
	// data into the new deployment. The new deployment will have a different endpoint, and the password will also
	// be reset for it. All other user settings will remain the same.
	// The old deployment will not be touched.
	// Required permissions:
	// if project_id is specified
	// - backup.backup.get on the backup specified by backup_id in request
	// - replication.deployment.clone-from-backup on the project specified in request
	// if project_id is not specified
	// - replication.deployment.clone-from-backup on the backup specified by backup_id
	CloneDeploymentFromBackup(context.Context, *CloneDeploymentFromBackupRequest) (*v11.Deployment, error)
	// Get an existing DeploymentReplication using its deployment ID
	// Required permissions:
	// - replication.deploymentreplication.get
	GetDeploymentReplication(context.Context, *v1.IDOptions) (*DeploymentReplication, error)
	// Update an existing DeploymentReplication spec. If does not exist, this will create a new one.
	// This call expects the complete entity with the updated fields.
	// Required permissions:
	// - replication.deploymentreplication.update
	UpdateDeploymentReplication(context.Context, *DeploymentReplication) (*DeploymentReplication, error)
}

ReplicationServiceServer is the server API for ReplicationService service.

type UnimplementedReplicationServiceServer

type UnimplementedReplicationServiceServer struct {
}

UnimplementedReplicationServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedReplicationServiceServer) CloneDeploymentFromBackup

func (*UnimplementedReplicationServiceServer) GetAPIVersion

func (*UnimplementedReplicationServiceServer) GetDeploymentReplication added in v0.75.0

func (*UnimplementedReplicationServiceServer) UpdateDeploymentReplication added in v0.75.0

Jump to

Keyboard shortcuts

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