Storage
Kubemq gcp-storage target connector allows services using kubemq server to access google storage server.

Prerequisites

The following required to run the gcp-storage target connector:
  • kubemq cluster
  • gcp-storage set up
  • kubemq-source deployment

Configuration

storage target connector configuration properties:
Properties Key
Required
Description
Example
credentials
yes
gcp credentials files
"<google json credentials"
Example:
1
bindings:
2
- name: kubemq-query-gcp-storage
3
source:
4
kind: kubemq.query
5
name: kubemq-query
6
properties:
7
address: "kubemq-cluster:50000"
8
client_id: "kubemq-query-gcp-storage-connector"
9
auth_token: ""
10
channel: "query.gcp.storage"
11
group: ""
12
auto_reconnect: "true"
13
reconnect_interval_seconds: "1"
14
max_reconnects: "0"
15
target:
16
kind: gcp.storage
17
name: gcp-storage
18
properties:
19
credentials: 'json'
Copied!

Usage

Create bucket

create a new bucket under storage
Create bucket metadata settings:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"create_bucket"
bucket
yes
bucket name
"bucket name"
storage_class
yes
gcp-storage_class
"storage_class"
project_id
yes
gcp storage project_id
"/myproject"
location
yes
gcp storage valid location
"gcp-supported locations"
Example:
1
{
2
"metadata": {
3
"method": "create_bucket",
4
"bucket": "myBucketName",
5
"storage_class": "COLDLINE",
6
"project_id": "MyID",
7
"location": "us"
8
},
9
"data": null
10
}
Copied!

Upload file

upload a file to selected bucket
Upload file metadata settings:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"upload"
bucket
yes
bucket name
"bucket name"
object
yes
object name to save the file under
"anyString"
path
yes
path to the file to upload
"<absolute or relative path to file/filename.type>"
Example:
1
{
2
"metadata": {
3
"method": "upload",
4
"bucket": "myBucketName",
5
"object": "MyFile",
6
"path": "./myFile.yaml"
7
},
8
"data": null
9
}
Copied!

Delete file

delete file from a bucket
Delete file metadata settings:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"delete"
bucket
yes
bucket name
"bucket name"
object
yes
object name
"anyString"
Example:
1
{
2
"metadata": {
3
"method": "delete",
4
"bucket": "myBucketName",
5
"object": "MyFile"
6
},
7
"data": null
8
}
Copied!

Download file

download file from bucket by object name
Download file metadata settings:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"download"
bucket
yes
bucket name
"bucket name"
object
yes
object name
"anyString"
Example:
1
{
2
"metadata": {
3
"method": "download",
4
"bucket": "myBucketName",
5
"object": "MyFile"
6
},
7
"data": null
8
}
Copied!

Rename file

rename an object under the same bucket
Rename file metadata settings:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"rename"
bucket
yes
bucket name
"bucket name"
object
yes
old object name
"anyString"
rename_object
yes
new object name
"anyString"
Example:
1
{
2
"metadata": {
3
"method": "rename",
4
"bucket": "myBucketName",
5
"object": "MyOldFile",
6
"rename_object": "MyNewFile"
7
},
8
"data": null
9
}
Copied!

Copy file

copy file from one bucket to another
Copy file metadata settings:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"copy"
bucket
yes
old bucket name
"bucket name"
dst_bucket
yes
new bucket name(can be the same)
"bucket name"
object
yes
old object name
"anyString"
rename_object
yes
new object name(can be the same)
"anyString"
Example:
1
{
2
"metadata": {
3
"method": "copy",
4
"bucket": "myOldBucketName",
5
"dst_bucket": "myNewBucketName",
6
"object": "MyOldFile",
7
"rename_object": "MyNewFile"
8
},
9
"data": null
10
}
Copied!

Move file

move a file from one bucket to another
Move file metadata settings:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"move"
bucket
yes
old bucket name
"bucket name"
dst_bucket
yes
new bucket name(can be the same)
"bucket name"
object
yes
old object name
"anyString"
rename_object
yes
new object name(can be the same)
"anyString"
Example:
1
{
2
"metadata": {
3
"method": "move",
4
"bucket": "myOldBucketName",
5
"dst_bucket": "myNewBucketName",
6
"object": "MyOldFile",
7
"rename_object": "MyNewFile"
8
},
9
"data": null
10
}
Copied!

List files

list all files from a bucket
List files metadata settings:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"list"
bucket
yes
old bucket name
"bucket name"
Example:
1
{
2
"metadata": {
3
"method": "list",
4
"bucket": "myBucketName"
5
},
6
"data": null
7
}
Copied!
Last modified 11mo ago