Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OperationType_name = map[int32]string{
		0: "OPERATION_TYPE_UNSPECIFIED",
		1: "EXPORT_ENTITIES",
		2: "IMPORT_ENTITIES",
	}
	OperationType_value = map[string]int32{
		"OPERATION_TYPE_UNSPECIFIED": 0,
		"EXPORT_ENTITIES":            1,
		"IMPORT_ENTITIES":            2,
	}
)

Enum value maps for OperationType.

View Source
var (
	CommonMetadata_State_name = map[int32]string{
		0: "STATE_UNSPECIFIED",
		1: "INITIALIZING",
		2: "PROCESSING",
		3: "CANCELLING",
		4: "FINALIZING",
		5: "SUCCESSFUL",
		6: "FAILED",
		7: "CANCELLED",
	}
	CommonMetadata_State_value = map[string]int32{
		"STATE_UNSPECIFIED": 0,
		"INITIALIZING":      1,
		"PROCESSING":        2,
		"CANCELLING":        3,
		"FINALIZING":        4,
		"SUCCESSFUL":        5,
		"FAILED":            6,
		"CANCELLED":         7,
	}
)

Enum value maps for CommonMetadata_State.

View Source
var File_google_datastore_admin_v1beta1_datastore_admin_proto protoreflect.FileDescriptor

Functions

func RegisterDatastoreAdminServer

func RegisterDatastoreAdminServer(s *grpc.Server, srv DatastoreAdminServer)

Types

type CommonMetadata

type CommonMetadata struct {

	// The time that work began on the operation.
	StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	// The time the operation ended, either successfully or otherwise.
	EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	// The type of the operation. Can be used as a filter in
	// ListOperationsRequest.
	OperationType OperationType `` /* 151-byte string literal not displayed */
	// The client-assigned labels which were provided when the operation was
	// created. May also include additional labels.
	Labels map[string]string `` /* 153-byte string literal not displayed */
	// The current state of the Operation.
	State CommonMetadata_State `protobuf:"varint,5,opt,name=state,proto3,enum=google.datastore.admin.v1beta1.CommonMetadata_State" json:"state,omitempty"`
	// contains filtered or unexported fields
}

Metadata common to all Datastore Admin operations.

func (*CommonMetadata) Descriptor

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

Deprecated: Use CommonMetadata.ProtoReflect.Descriptor instead.

func (*CommonMetadata) GetEndTime

func (x *CommonMetadata) GetEndTime() *timestamppb.Timestamp

func (*CommonMetadata) GetLabels

func (x *CommonMetadata) GetLabels() map[string]string

func (*CommonMetadata) GetOperationType

func (x *CommonMetadata) GetOperationType() OperationType

func (*CommonMetadata) GetStartTime

func (x *CommonMetadata) GetStartTime() *timestamppb.Timestamp

func (*CommonMetadata) GetState

func (x *CommonMetadata) GetState() CommonMetadata_State

func (*CommonMetadata) ProtoMessage

func (*CommonMetadata) ProtoMessage()

func (*CommonMetadata) ProtoReflect

func (x *CommonMetadata) ProtoReflect() protoreflect.Message

func (*CommonMetadata) Reset

func (x *CommonMetadata) Reset()

func (*CommonMetadata) String

func (x *CommonMetadata) String() string

type CommonMetadata_State

type CommonMetadata_State int32

The various possible states for an ongoing Operation.

const (
	// Unspecified.
	CommonMetadata_STATE_UNSPECIFIED CommonMetadata_State = 0
	// Request is being prepared for processing.
	CommonMetadata_INITIALIZING CommonMetadata_State = 1
	// Request is actively being processed.
	CommonMetadata_PROCESSING CommonMetadata_State = 2
	// Request is in the process of being cancelled after user called
	// google.longrunning.Operations.CancelOperation on the operation.
	CommonMetadata_CANCELLING CommonMetadata_State = 3
	// Request has been processed and is in its finalization stage.
	CommonMetadata_FINALIZING CommonMetadata_State = 4
	// Request has completed successfully.
	CommonMetadata_SUCCESSFUL CommonMetadata_State = 5
	// Request has finished being processed, but encountered an error.
	CommonMetadata_FAILED CommonMetadata_State = 6
	// Request has finished being cancelled after user called
	// google.longrunning.Operations.CancelOperation.
	CommonMetadata_CANCELLED CommonMetadata_State = 7
)

func (CommonMetadata_State) Descriptor

func (CommonMetadata_State) Enum

func (CommonMetadata_State) EnumDescriptor

func (CommonMetadata_State) EnumDescriptor() ([]byte, []int)

Deprecated: Use CommonMetadata_State.Descriptor instead.

func (CommonMetadata_State) Number

func (CommonMetadata_State) String

func (x CommonMetadata_State) String() string

func (CommonMetadata_State) Type

type DatastoreAdminClient

type DatastoreAdminClient interface {
	// Exports a copy of all or a subset of entities from Google Cloud Datastore
	// to another storage system, such as Google Cloud Storage. Recent updates to
	// entities may not be reflected in the export. The export occurs in the
	// background and its progress can be monitored and managed via the
	// Operation resource that is created. The output of an export may only be
	// used once the associated operation is done. If an export operation is
	// cancelled before completion it may leave partial data behind in Google
	// Cloud Storage.
	ExportEntities(ctx context.Context, in *ExportEntitiesRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
	// Imports entities into Google Cloud Datastore. Existing entities with the
	// same key are overwritten. The import occurs in the background and its
	// progress can be monitored and managed via the Operation resource that is
	// created. If an ImportEntities operation is cancelled, it is possible
	// that a subset of the data has already been imported to Cloud Datastore.
	ImportEntities(ctx context.Context, in *ImportEntitiesRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
}

DatastoreAdminClient is the client API for DatastoreAdmin service.

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

type DatastoreAdminServer

type DatastoreAdminServer interface {
	// Exports a copy of all or a subset of entities from Google Cloud Datastore
	// to another storage system, such as Google Cloud Storage. Recent updates to
	// entities may not be reflected in the export. The export occurs in the
	// background and its progress can be monitored and managed via the
	// Operation resource that is created. The output of an export may only be
	// used once the associated operation is done. If an export operation is
	// cancelled before completion it may leave partial data behind in Google
	// Cloud Storage.
	ExportEntities(context.Context, *ExportEntitiesRequest) (*longrunning.Operation, error)
	// Imports entities into Google Cloud Datastore. Existing entities with the
	// same key are overwritten. The import occurs in the background and its
	// progress can be monitored and managed via the Operation resource that is
	// created. If an ImportEntities operation is cancelled, it is possible
	// that a subset of the data has already been imported to Cloud Datastore.
	ImportEntities(context.Context, *ImportEntitiesRequest) (*longrunning.Operation, error)
}

DatastoreAdminServer is the server API for DatastoreAdmin service.

type EntityFilter

type EntityFilter struct {

	// If empty, then this represents all kinds.
	Kinds []string `protobuf:"bytes,1,rep,name=kinds,proto3" json:"kinds,omitempty"`
	// An empty list represents all namespaces. This is the preferred
	// usage for projects that don't use namespaces.
	//
	// An empty string element represents the default namespace. This should be
	// used if the project has data in non-default namespaces, but doesn't want to
	// include them.
	// Each namespace in this list must be unique.
	NamespaceIds []string `protobuf:"bytes,2,rep,name=namespace_ids,json=namespaceIds,proto3" json:"namespace_ids,omitempty"`
	// contains filtered or unexported fields
}

Identifies a subset of entities in a project. This is specified as combinations of kinds and namespaces (either or both of which may be all, as described in the following examples). Example usage:

Entire project:

kinds=[], namespace_ids=[]

Kinds Foo and Bar in all namespaces:

kinds=['Foo', 'Bar'], namespace_ids=[]

Kinds Foo and Bar only in the default namespace:

kinds=['Foo', 'Bar'], namespace_ids=['']

Kinds Foo and Bar in both the default and Baz namespaces:

kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']

The entire Baz namespace:

kinds=[], namespace_ids=['Baz']

func (*EntityFilter) Descriptor

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

Deprecated: Use EntityFilter.ProtoReflect.Descriptor instead.

func (*EntityFilter) GetKinds

func (x *EntityFilter) GetKinds() []string

func (*EntityFilter) GetNamespaceIds

func (x *EntityFilter) GetNamespaceIds() []string

func (*EntityFilter) ProtoMessage

func (*EntityFilter) ProtoMessage()

func (*EntityFilter) ProtoReflect

func (x *EntityFilter) ProtoReflect() protoreflect.Message

func (*EntityFilter) Reset

func (x *EntityFilter) Reset()

func (*EntityFilter) String

func (x *EntityFilter) String() string

type ExportEntitiesMetadata

type ExportEntitiesMetadata struct {

	// Metadata common to all Datastore Admin operations.
	Common *CommonMetadata `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"`
	// An estimate of the number of entities processed.
	ProgressEntities *Progress `protobuf:"bytes,2,opt,name=progress_entities,json=progressEntities,proto3" json:"progress_entities,omitempty"`
	// An estimate of the number of bytes processed.
	ProgressBytes *Progress `protobuf:"bytes,3,opt,name=progress_bytes,json=progressBytes,proto3" json:"progress_bytes,omitempty"`
	// Description of which entities are being exported.
	EntityFilter *EntityFilter `protobuf:"bytes,4,opt,name=entity_filter,json=entityFilter,proto3" json:"entity_filter,omitempty"`
	// Location for the export metadata and data files. This will be the same
	// value as the
	// [google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix]
	// field. The final output location is provided in
	// [google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url][google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url].
	OutputUrlPrefix string `protobuf:"bytes,5,opt,name=output_url_prefix,json=outputUrlPrefix,proto3" json:"output_url_prefix,omitempty"`
	// contains filtered or unexported fields
}

Metadata for ExportEntities operations.

func (*ExportEntitiesMetadata) Descriptor

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

Deprecated: Use ExportEntitiesMetadata.ProtoReflect.Descriptor instead.

func (*ExportEntitiesMetadata) GetCommon

func (x *ExportEntitiesMetadata) GetCommon() *CommonMetadata

func (*ExportEntitiesMetadata) GetEntityFilter

func (x *ExportEntitiesMetadata) GetEntityFilter() *EntityFilter

func (*ExportEntitiesMetadata) GetOutputUrlPrefix

func (x *ExportEntitiesMetadata) GetOutputUrlPrefix() string

func (*ExportEntitiesMetadata) GetProgressBytes

func (x *ExportEntitiesMetadata) GetProgressBytes() *Progress

func (*ExportEntitiesMetadata) GetProgressEntities

func (x *ExportEntitiesMetadata) GetProgressEntities() *Progress

func (*ExportEntitiesMetadata) ProtoMessage

func (*ExportEntitiesMetadata) ProtoMessage()

func (*ExportEntitiesMetadata) ProtoReflect

func (x *ExportEntitiesMetadata) ProtoReflect() protoreflect.Message

func (*ExportEntitiesMetadata) Reset

func (x *ExportEntitiesMetadata) Reset()

func (*ExportEntitiesMetadata) String

func (x *ExportEntitiesMetadata) String() string

type ExportEntitiesRequest

type ExportEntitiesRequest struct {

	// Project ID against which to make the request.
	ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	// Client-assigned labels.
	Labels map[string]string `` /* 153-byte string literal not displayed */
	// Description of what data from the project is included in the export.
	EntityFilter *EntityFilter `protobuf:"bytes,3,opt,name=entity_filter,json=entityFilter,proto3" json:"entity_filter,omitempty"`
	// Location for the export metadata and data files.
	//
	// The full resource URL of the external storage location. Currently, only
	// Google Cloud Storage is supported. So output_url_prefix should be of the
	// form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
	// name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
	// Storage namespace path (this is not a Cloud Datastore namespace). For more
	// information about Cloud Storage namespace paths, see
	// [Object name
	// considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
	//
	// The resulting files will be nested deeper than the specified URL prefix.
	// The final output URL will be provided in the
	// [google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url][google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url]
	// field. That value should be used for subsequent ImportEntities operations.
	//
	// By nesting the data files deeper, the same Cloud Storage bucket can be used
	// in multiple ExportEntities operations without conflict.
	OutputUrlPrefix string `protobuf:"bytes,4,opt,name=output_url_prefix,json=outputUrlPrefix,proto3" json:"output_url_prefix,omitempty"`
	// contains filtered or unexported fields
}

The request for [google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities].

func (*ExportEntitiesRequest) Descriptor

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

Deprecated: Use ExportEntitiesRequest.ProtoReflect.Descriptor instead.

func (*ExportEntitiesRequest) GetEntityFilter

func (x *ExportEntitiesRequest) GetEntityFilter() *EntityFilter

func (*ExportEntitiesRequest) GetLabels

func (x *ExportEntitiesRequest) GetLabels() map[string]string

func (*ExportEntitiesRequest) GetOutputUrlPrefix

func (x *ExportEntitiesRequest) GetOutputUrlPrefix() string

func (*ExportEntitiesRequest) GetProjectId

func (x *ExportEntitiesRequest) GetProjectId() string

func (*ExportEntitiesRequest) ProtoMessage

func (*ExportEntitiesRequest) ProtoMessage()

func (*ExportEntitiesRequest) ProtoReflect

func (x *ExportEntitiesRequest) ProtoReflect() protoreflect.Message

func (*ExportEntitiesRequest) Reset

func (x *ExportEntitiesRequest) Reset()

func (*ExportEntitiesRequest) String

func (x *ExportEntitiesRequest) String() string

type ExportEntitiesResponse

type ExportEntitiesResponse struct {

	// Location of the output metadata file. This can be used to begin an import
	// into Cloud Datastore (this project or another project). See
	// [google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url][google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url].
	// Only present if the operation completed successfully.
	OutputUrl string `protobuf:"bytes,1,opt,name=output_url,json=outputUrl,proto3" json:"output_url,omitempty"`
	// contains filtered or unexported fields
}

The response for [google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities].

func (*ExportEntitiesResponse) Descriptor

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

Deprecated: Use ExportEntitiesResponse.ProtoReflect.Descriptor instead.

func (*ExportEntitiesResponse) GetOutputUrl

func (x *ExportEntitiesResponse) GetOutputUrl() string

func (*ExportEntitiesResponse) ProtoMessage

func (*ExportEntitiesResponse) ProtoMessage()

func (*ExportEntitiesResponse) ProtoReflect

func (x *ExportEntitiesResponse) ProtoReflect() protoreflect.Message

func (*ExportEntitiesResponse) Reset

func (x *ExportEntitiesResponse) Reset()

func (*ExportEntitiesResponse) String

func (x *ExportEntitiesResponse) String() string

type ImportEntitiesMetadata

type ImportEntitiesMetadata struct {

	// Metadata common to all Datastore Admin operations.
	Common *CommonMetadata `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"`
	// An estimate of the number of entities processed.
	ProgressEntities *Progress `protobuf:"bytes,2,opt,name=progress_entities,json=progressEntities,proto3" json:"progress_entities,omitempty"`
	// An estimate of the number of bytes processed.
	ProgressBytes *Progress `protobuf:"bytes,3,opt,name=progress_bytes,json=progressBytes,proto3" json:"progress_bytes,omitempty"`
	// Description of which entities are being imported.
	EntityFilter *EntityFilter `protobuf:"bytes,4,opt,name=entity_filter,json=entityFilter,proto3" json:"entity_filter,omitempty"`
	// The location of the import metadata file. This will be the same value as
	// the
	// [google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url][google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url]
	// field.
	InputUrl string `protobuf:"bytes,5,opt,name=input_url,json=inputUrl,proto3" json:"input_url,omitempty"`
	// contains filtered or unexported fields
}

Metadata for ImportEntities operations.

func (*ImportEntitiesMetadata) Descriptor

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

Deprecated: Use ImportEntitiesMetadata.ProtoReflect.Descriptor instead.

func (*ImportEntitiesMetadata) GetCommon

func (x *ImportEntitiesMetadata) GetCommon() *CommonMetadata

func (*ImportEntitiesMetadata) GetEntityFilter

func (x *ImportEntitiesMetadata) GetEntityFilter() *EntityFilter

func (*ImportEntitiesMetadata) GetInputUrl

func (x *ImportEntitiesMetadata) GetInputUrl() string

func (*ImportEntitiesMetadata) GetProgressBytes

func (x *ImportEntitiesMetadata) GetProgressBytes() *Progress

func (*ImportEntitiesMetadata) GetProgressEntities

func (x *ImportEntitiesMetadata) GetProgressEntities() *Progress

func (*ImportEntitiesMetadata) ProtoMessage

func (*ImportEntitiesMetadata) ProtoMessage()

func (*ImportEntitiesMetadata) ProtoReflect

func (x *ImportEntitiesMetadata) ProtoReflect() protoreflect.Message

func (*ImportEntitiesMetadata) Reset

func (x *ImportEntitiesMetadata) Reset()

func (*ImportEntitiesMetadata) String

func (x *ImportEntitiesMetadata) String() string

type ImportEntitiesRequest

type ImportEntitiesRequest struct {

	// Project ID against which to make the request.
	ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	// Client-assigned labels.
	Labels map[string]string `` /* 153-byte string literal not displayed */
	// The full resource URL of the external storage location. Currently, only
	// Google Cloud Storage is supported. So input_url should be of the form:
	// `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
	// `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
	// an optional Cloud Storage namespace path (this is not a Cloud Datastore
	// namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
	// by the ExportEntities operation. For more information about Cloud Storage
	// namespace paths, see
	// [Object name
	// considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
	//
	// For more information, see
	// [google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url][google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url].
	InputUrl string `protobuf:"bytes,3,opt,name=input_url,json=inputUrl,proto3" json:"input_url,omitempty"`
	// Optionally specify which kinds/namespaces are to be imported. If provided,
	// the list must be a subset of the EntityFilter used in creating the export,
	// otherwise a FAILED_PRECONDITION error will be returned. If no filter is
	// specified then all entities from the export are imported.
	EntityFilter *EntityFilter `protobuf:"bytes,4,opt,name=entity_filter,json=entityFilter,proto3" json:"entity_filter,omitempty"`
	// contains filtered or unexported fields
}

The request for [google.datastore.admin.v1beta1.DatastoreAdmin.ImportEntities][google.datastore.admin.v1beta1.DatastoreAdmin.ImportEntities].

func (*ImportEntitiesRequest) Descriptor

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

Deprecated: Use ImportEntitiesRequest.ProtoReflect.Descriptor instead.

func (*ImportEntitiesRequest) GetEntityFilter

func (x *ImportEntitiesRequest) GetEntityFilter() *EntityFilter

func (*ImportEntitiesRequest) GetInputUrl

func (x *ImportEntitiesRequest) GetInputUrl() string

func (*ImportEntitiesRequest) GetLabels

func (x *ImportEntitiesRequest) GetLabels() map[string]string

func (*ImportEntitiesRequest) GetProjectId

func (x *ImportEntitiesRequest) GetProjectId() string

func (*ImportEntitiesRequest) ProtoMessage

func (*ImportEntitiesRequest) ProtoMessage()

func (*ImportEntitiesRequest) ProtoReflect

func (x *ImportEntitiesRequest) ProtoReflect() protoreflect.Message

func (*ImportEntitiesRequest) Reset

func (x *ImportEntitiesRequest) Reset()

func (*ImportEntitiesRequest) String

func (x *ImportEntitiesRequest) String() string

type OperationType

type OperationType int32

Operation types.

const (
	// Unspecified.
	OperationType_OPERATION_TYPE_UNSPECIFIED OperationType = 0
	// ExportEntities.
	OperationType_EXPORT_ENTITIES OperationType = 1
	// ImportEntities.
	OperationType_IMPORT_ENTITIES OperationType = 2
)

func (OperationType) Descriptor

func (OperationType) Enum

func (x OperationType) Enum() *OperationType

func (OperationType) EnumDescriptor

func (OperationType) EnumDescriptor() ([]byte, []int)

Deprecated: Use OperationType.Descriptor instead.

func (OperationType) Number

func (OperationType) String

func (x OperationType) String() string

func (OperationType) Type

type Progress

type Progress struct {

	// The amount of work that has been completed. Note that this may be greater
	// than work_estimated.
	WorkCompleted int64 `protobuf:"varint,1,opt,name=work_completed,json=workCompleted,proto3" json:"work_completed,omitempty"`
	// An estimate of how much work needs to be performed. May be zero if the
	// work estimate is unavailable.
	WorkEstimated int64 `protobuf:"varint,2,opt,name=work_estimated,json=workEstimated,proto3" json:"work_estimated,omitempty"`
	// contains filtered or unexported fields
}

Measures the progress of a particular metric.

func (*Progress) Descriptor

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

Deprecated: Use Progress.ProtoReflect.Descriptor instead.

func (*Progress) GetWorkCompleted

func (x *Progress) GetWorkCompleted() int64

func (*Progress) GetWorkEstimated

func (x *Progress) GetWorkEstimated() int64

func (*Progress) ProtoMessage

func (*Progress) ProtoMessage()

func (*Progress) ProtoReflect

func (x *Progress) ProtoReflect() protoreflect.Message

func (*Progress) Reset

func (x *Progress) Reset()

func (*Progress) String

func (x *Progress) String() string

type UnimplementedDatastoreAdminServer

type UnimplementedDatastoreAdminServer struct {
}

UnimplementedDatastoreAdminServer can be embedded to have forward compatible implementations.

func (*UnimplementedDatastoreAdminServer) ExportEntities

func (*UnimplementedDatastoreAdminServer) ImportEntities