Database
-
Create database
- Using argument
- Using file
Use command :
initz create dataservice --name=<name> --type=<type> --mode=<mode> --replicas=<replicas> --size=<size> --storage=<storage> --backupschedule=<backup-schedule>
Flags
--name
- Indicates the name of the database.
- required
- Shorthand :
n
--type
- Indicates the type of the database.
- Possible values :
mongoDB/postgresql/redis/qdrant
- required
--mode
- Indicates the runtype (prod/non-prod).
- Optional
- Default :
prod
--replicas
- Indicates the number of replicas (1/3/5).
- Optional
- Default :
1
--size
- Indicates the size of the database.(Small-1GB RAM | 0.5 vCPU/Default-1GB RAM | 1 vCPU/Large-4GB RAM | 2 vCPU )
- Optional
- Default :
Small
--storage
- Indicates the storage of the database.(20 to 500).
- Optional
- Default :
20
--backupschedule
- Indicates the backup schedule
- Optional
- Default :
daily
- Possible values :
daily/weekly/monthly
Use command :
initz create dataservice -f <database.json/database.yaml>
Example template :
- JSON
- YAML
database.json{
"name": "example",
"data_service_type": "mongodb",
"mode": "prod",
"replicas": 1,
"size": "Default",
"storage": 20,
"workspace_id": "669ddebbbc8c54a247229e78"
}database.yamlname: example
data_service_type: mongodb
mode: prod
replicas: 1
size: Default
storage: 20
workspace_id: 669ddebbbc8c54a247229e78You can either use the configuration provided in the file above to create the database or generate your own example configuration to do so.
Generate configuration :
- JSON
- YAML
database.jsoninitz create dataservice -t json --name=<name> --type=<type> --mode=<mode> --replicas=<replicas> --size=<size> --storage=<storage>
database.yamlinitz create dataservice -t yaml --name=<name> --type=<type> --mode=<mode> --replicas=<replicas> --size=<size> --storage=<storage>
Flags
--template
- Need to pass the format(
json/yaml
) of the template(example configuration) to create the database via file. - shorthand :
t
-
Update database
- Using argument
- Using file
initz edit dataservice --name=<database-name> --replicas=<replicas> --storage=<storage> --size=<size>
Flags
--name
- Indicates the name of the database.
- required
- Shorthand :
n
--replicas
- Indicates the number of replicas (1/3/5).
- Optional
- Default :
1
--size
- Indicates the size of the database.(Small-1GB RAM | 0.5 vCPU/Default-1GB RAM | 1 vCPU/Large-4GB RAM | 2 vCPU )
- Optional
- Default :
Small
--storage
- Indicates the storage of the database.(20 to 500).
- Optional
- Default :
20
initz edit dataservice --name=<database-name> -f <dataservice.json/dataservice.yaml>
Example template :
- JSON
- YAML
dataservice.json{
"replicas": 1,
"size": "Small",
"storage": 20
}dataservice.yamlreplicas: 1
size: Small
storage: 20You can either use the configuration provided in the file above to create the database or generate your own example configuration to do so.
Generate configuration :
- JSON
- YAML
dataservice.jsoninitz edit dataservice -t json --name=<name> --replicas=<replicas> --storage=<storage> --size=<size>
dataservice.yamlinitz edit dataservice -t yaml --name=<name> --replicas=<replicas> --storage=<storage> --size=<size>
Flags
--template
- Need to pass the format(
json/yaml
) of the template(example configuration) to create the database via file. - shorthand :
t
-
Delete database
Use command :
initz delete dataservice --name <name>
Flags
--name
- Indicates the name of the database.
- required
- Shorthand :
n
-
Get list of snapshots
Use command :
initz get snapshot --name <dataservice-name>
Flags
--name
- Indicates the name of the database.
- required
- Shorthand :
n
-
Snapshot Restoration
Use command :
initz restore --name <dataservice-name> --snapshot <snapshot-name>
Flags
--name
- Indicates the name of the database.
- required
- Shorthand :
n
--snapshot
- Indicates the name of the snapshot that needs to be restored.
- required
- To get the Snapshot Name Refer :
initz get snapshot --name <dataservice-name>
-
How to get list of databases
Use command :
initz get databases
-
Describe a database
Use command :
initz describe dataservice --name <name>
Flags
--name
- Indicates the name of the database.
- required
- Shorthand :
n
-
Download CA certifiacte
Use command :
initz download cacrt --name <name>
Flags
--name
- Indicates the name of the database.
- required
- Shorthand :
n
info- The CA certificate is available only for PostgreSQL and Redis.
-
Check database name
To check data service name is available or not, use command :
initz check dataservice --name <name>
Flags
--name
- Indicates the name of the database.
- required
- Shorthand :
n