Cloud Servers API: Difference between revisions
WikiSysopdi (talk | contribs) (Created page with "'''Syntax''' : registercloudserver <NAME> <API_GEO_LOCATION> <CONNECTION_STRING> <ENTER> eg.registercloudserver "NAME" "API GEO LOCATION" "CONNECTION STRING" Description : Register a cloud server. User can also see list of cloud server by entering just "registercloudserver" without any parameter. <NAME> - Name of the registered server <API_GEO_LOCATION> - This defines which API is to be used. Options are "US", "UK", "DE" and "CA" <CONNECTION_STRING> - the postgr...") |
WikiSysopdi (talk | contribs) No edit summary |
||
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
COMING SOON IN 2025 | |||
==== Register your Cloud Server ==== | |||
'''Syntax''' : registercloudserver <NAME> <API_GEO_LOCATION> <CONNECTION_STRING> <ENTER> | '''Syntax''' : registercloudserver <NAME> <API_GEO_LOCATION> <CONNECTION_STRING> <ENTER> | ||
Line 13: | Line 16: | ||
EG | EG | ||
"host=yourserver.ondigitalocean.com;username=someadminuser;password=somepassword;database=defaultdb;port=25060;sslmode=Require;trust server certificate=true;Pooling=true;Connection Idle Lifetime = 2;Connection Pruning Interval = 2;Include Error Detail=true" | "host=yourserver.ondigitalocean.com;username=someadminuser;password=somepassword;database=defaultdb;port=25060;sslmode=Require;trust server certificate=true;Pooling=true;Connection Idle Lifetime = 2;Connection Pruning Interval = 2;Include Error Detail=true" | ||
==== Switch to a server ==== | |||
'''Syntax''' : registercloudserver <INDEX> | |||
Where INDEX is the number beside the server as listed by | |||
>registercloudserver | |||
with no parameters | |||
==== Delete a server ==== | |||
'''Syntax''' : unregistercloudserver <NAME> | |||
eg.unregistercloudserver "NAME" | |||
Description : To delete a cloud server by giving their name. | |||
Note: We first check if we have any linked region on this server and if so we display warning. | |||
Deleting and re-adding a server will not re-associate regions with the server | |||
== REST API == | |||
<nowiki>#</nowiki>GET_CLOUD_SERVERS | |||
MethodType: GET | |||
Url: https://apidev.crmtogether.com/mastercloudserver | |||
<nowiki>#</nowiki>Add_CLOUD_SERVER | |||
MethodType: POST | |||
Url: https://apidev.crmtogether.com/mastercloudserver | |||
Payload: [ | |||
{ | |||
"name":"test-server2", | |||
"geo_region":"de", | |||
"con_key":"CONNECTION_STRING;Connection Pruning Interval = 2;Include Error Detail=true;", | |||
"user_id":"9684407f-4a6d-497b-a1b9-2094977c9378", | |||
"default": true | |||
} | |||
] | |||
<nowiki>#</nowiki>UPDATE_CLOUD_SERVER | |||
MethodType: PUT | |||
Url: https://apidev.crmtogether.com/mastercloudserver | |||
Payload: { | |||
"columns": "\"name\"='test-server2'", | |||
"dataTable": [ | |||
{ | |||
"con_string": "CONNECTION_STRING" | |||
} | |||
] | |||
} | |||
<nowiki>#</nowiki>DELETE_CLOUD_SERVER | |||
MethodType: DELETE | |||
Url: https://apidev.crmtogether.com/mastercloudserver/<CLOUD_SEVER_NAME> |
Latest revision as of 15:20, 28 January 2025
COMING SOON IN 2025
Register your Cloud Server
Syntax : registercloudserver <NAME> <API_GEO_LOCATION> <CONNECTION_STRING> <ENTER>
eg.registercloudserver "NAME" "API GEO LOCATION" "CONNECTION STRING"
Description : Register a cloud server. User can also see list of cloud server by entering just "registercloudserver" without any parameter.
<NAME> - Name of the registered server
<API_GEO_LOCATION> - This defines which API is to be used. Options are "US", "UK", "DE" and "CA"
<CONNECTION_STRING> - the postgreSQL connection string
EG "host=yourserver.ondigitalocean.com;username=someadminuser;password=somepassword;database=defaultdb;port=25060;sslmode=Require;trust server certificate=true;Pooling=true;Connection Idle Lifetime = 2;Connection Pruning Interval = 2;Include Error Detail=true"
Switch to a server
Syntax : registercloudserver <INDEX>
Where INDEX is the number beside the server as listed by
>registercloudserver
with no parameters
Delete a server
Syntax : unregistercloudserver <NAME>
eg.unregistercloudserver "NAME"
Description : To delete a cloud server by giving their name.
Note: We first check if we have any linked region on this server and if so we display warning.
Deleting and re-adding a server will not re-associate regions with the server
REST API
#GET_CLOUD_SERVERS
MethodType: GET
Url: https://apidev.crmtogether.com/mastercloudserver
#Add_CLOUD_SERVER
MethodType: POST
Url: https://apidev.crmtogether.com/mastercloudserver
Payload: [
{ "name":"test-server2", "geo_region":"de", "con_key":"CONNECTION_STRING;Connection Pruning Interval = 2;Include Error Detail=true;", "user_id":"9684407f-4a6d-497b-a1b9-2094977c9378", "default": true } ]
#UPDATE_CLOUD_SERVER
MethodType: PUT
Url: https://apidev.crmtogether.com/mastercloudserver
Payload: {
"columns": "\"name\"='test-server2'", "dataTable": [ { "con_string": "CONNECTION_STRING" } ] }
#DELETE_CLOUD_SERVER
MethodType: DELETE
Url: https://apidev.crmtogether.com/mastercloudserver/<CLOUD_SEVER_NAME>