rl-cloud-api-sdk
Advanced tools
Comparing version 0.0.6 to 0.0.7
124
lib/api.d.ts
@@ -20,7 +20,11 @@ import { CreateSubscriptionParameters, UpdateSubscriptionParameters, UpdateSubscriptionCidrWhitelistParameters, CreateSubscriptionVpcPeeringParameters } from './interfaces/subscription'; | ||
*/ | ||
getAccountInformation(): Promise<any>; | ||
getAccountInformation(): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
* Returning a lookup list of database modules supported in current account (support may differ based on subscription and database settings) | ||
*/ | ||
getDatabaseModules(): Promise<any>; | ||
getDatabaseModules(): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -31,7 +35,11 @@ * Returning system log information for current account | ||
*/ | ||
getSystemLogs(limit: number, offset: number): Promise<any>; | ||
getSystemLogs(limit: number, offset: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
* Returning a lookup list of current account’s payment methods | ||
*/ | ||
getPaymentMethods(): Promise<any>; | ||
getPaymentMethods(): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -41,3 +49,5 @@ * Returning a lookup list of current account's plans | ||
*/ | ||
getPlans(provider: SubscriptionCloudProviderTypes): Promise<any>; | ||
getPlans(provider: SubscriptionCloudProviderTypes): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -47,7 +57,11 @@ * Returning a lookup list of current account's regions | ||
*/ | ||
getRegions(provider: SubscriptionCloudProviderTypes): Promise<any>; | ||
getRegions(provider: SubscriptionCloudProviderTypes): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
* Returning a lookup list of current account's subscriptions | ||
*/ | ||
getSubscriptions(): Promise<any>; | ||
getSubscriptions(): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -57,3 +71,5 @@ * Creating a subscription | ||
*/ | ||
createSubscription(createParameters: CreateSubscriptionParameters): Promise<any>; | ||
createSubscription(createParameters: CreateSubscriptionParameters): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -63,3 +79,5 @@ * Returning a subscription | ||
*/ | ||
getSubscription(subscriptionId: number): Promise<any>; | ||
getSubscription(subscriptionId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -70,3 +88,5 @@ * Updating a subscription | ||
*/ | ||
updateSubscription(subscriptionId: number, updateParameters: UpdateSubscriptionParameters): Promise<any>; | ||
updateSubscription(subscriptionId: number, updateParameters: UpdateSubscriptionParameters): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -76,3 +96,5 @@ * Deleting a subscription | ||
*/ | ||
deleteSubscription(subscriptionId: number): Promise<any>; | ||
deleteSubscription(subscriptionId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -82,3 +104,5 @@ * Returning a lookup list of a subscription CIDR whitelists | ||
*/ | ||
getSubscriptionCidrWhitelists(subscriptionId: number): Promise<any>; | ||
getSubscriptionCidrWhitelists(subscriptionId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -89,3 +113,5 @@ * Updating a subscription CIDR whitelists | ||
*/ | ||
updateSubscriptionCidrWhitelists(subscriptionId: number, updateParameters: UpdateSubscriptionCidrWhitelistParameters): Promise<any>; | ||
updateSubscriptionCidrWhitelists(subscriptionId: number, updateParameters: UpdateSubscriptionCidrWhitelistParameters): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -95,3 +121,5 @@ * Returning a lookup list of the subscription VPC Peerings | ||
*/ | ||
getSubscriptionVpcPeerings(subscriptionId: number): Promise<any>; | ||
getSubscriptionVpcPeerings(subscriptionId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -102,3 +130,5 @@ * Creating a subscription VPC peering | ||
*/ | ||
createSubscriptionVpcPeering(subscriptionId: number, createParameters: CreateSubscriptionVpcPeeringParameters): Promise<any>; | ||
createSubscriptionVpcPeering(subscriptionId: number, createParameters: CreateSubscriptionVpcPeeringParameters): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -109,3 +139,5 @@ * Deleting a subscription VPC peering | ||
*/ | ||
deleteSubscriptionVpcPeering(subscriptionId: number, vpcPeeringId: number): Promise<any>; | ||
deleteSubscriptionVpcPeering(subscriptionId: number, vpcPeeringId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -115,3 +147,5 @@ * Returning a lookup list of databases owned by the account | ||
*/ | ||
getDatabases(subscriptionId: number): Promise<any>; | ||
getDatabases(subscriptionId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -122,3 +156,5 @@ * Creating a database | ||
*/ | ||
createDatabase(subscriptionId: number, createParameters: CreateDatabaseParameters): Promise<any>; | ||
createDatabase(subscriptionId: number, createParameters: CreateDatabaseParameters): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -129,3 +165,5 @@ * Returning a database | ||
*/ | ||
getDatabase(subscriptionId: number, databaseId: number): Promise<any>; | ||
getDatabase(subscriptionId: number, databaseId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -137,3 +175,5 @@ * Updating a database | ||
*/ | ||
updateDatabase(subscriptionId: number, databaseId: number, updateParameters: UpdateDatabaseParameters): Promise<any>; | ||
updateDatabase(subscriptionId: number, databaseId: number, updateParameters: UpdateDatabaseParameters): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -144,3 +184,5 @@ * Deleting a database | ||
*/ | ||
deleteDatabase(subscriptionId: number, databaseId: number): Promise<any>; | ||
deleteDatabase(subscriptionId: number, databaseId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -151,3 +193,5 @@ * Backing up a database | ||
*/ | ||
backupDatabase(subscriptionId: number, databaseId: number): Promise<any>; | ||
backupDatabase(subscriptionId: number, databaseId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -159,7 +203,11 @@ * Importing a dataset into a database | ||
*/ | ||
importIntoDatabase(subscriptionId: number, databaseId: number, importParameters: DatabaseImportParameters): Promise<any>; | ||
importIntoDatabase(subscriptionId: number, databaseId: number, importParameters: DatabaseImportParameters): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
* Returning a lookup list of cloud accounts owned by the account | ||
*/ | ||
getCloudAccounts(): Promise<any>; | ||
getCloudAccounts(): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -169,3 +217,5 @@ * Creating a cloud account | ||
*/ | ||
createCloudAccount(createParameters: CreateCloudAccountParameters): Promise<any>; | ||
createCloudAccount(createParameters: CreateCloudAccountParameters): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -175,3 +225,5 @@ * Returning a cloud account | ||
*/ | ||
getCloudAccount(cloudAccountId: number): Promise<any>; | ||
getCloudAccount(cloudAccountId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -182,3 +234,5 @@ * Updating a cloud account | ||
*/ | ||
updateCloudAccount(cloudAccountId: number, updateParameters: UpdateCloudAccountParameters): Promise<any>; | ||
updateCloudAccount(cloudAccountId: number, updateParameters: UpdateCloudAccountParameters): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -188,4 +242,8 @@ * Deleting a cloud account | ||
*/ | ||
deleteCloudAccount(cloudAccountId: number): Promise<any>; | ||
getTasks(): Promise<any>; | ||
deleteCloudAccount(cloudAccountId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
getTasks(): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -195,3 +253,5 @@ * Returning a task | ||
*/ | ||
getTask(taskId: number): Promise<any>; | ||
getTask(taskId: number): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -228,3 +288,5 @@ * Waiting for the subscription status to change to a given status | ||
*/ | ||
waitForTaskStatus(taskId: number, expectedStatus: TaskStatus): Promise<any>; | ||
waitForTaskStatus(taskId: number, expectedStatus: TaskStatus): Promise<{ | ||
[key: string]: any; | ||
}>; | ||
/** | ||
@@ -231,0 +293,0 @@ * Freezing the code for a number of seconds |
@@ -451,2 +451,8 @@ "use strict"; | ||
catch (error) { | ||
console.log(error); | ||
if (error.response) { | ||
console.log(error.response.data); | ||
console.log(error.response.status); | ||
console.log(error.response.headers); | ||
} | ||
return error; | ||
@@ -453,0 +459,0 @@ } |
{ | ||
"name": "rl-cloud-api-sdk", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "This is a client for the Redislabs Cloud API ", | ||
@@ -8,7 +8,12 @@ "main": "lib/index.js", | ||
"build": "tsc", | ||
"test-all": "mocha -r ts-node/register tests/*.ts", | ||
"test-general": "mocha -r ts-node/register tests/general.ts", | ||
"test-cloud-account": "mocha -r ts-node/register tests/cloud-account.ts", | ||
"test-database": "mocha -r ts-node/register tests/database.ts", | ||
"test-subscription": "mocha -r ts-node/register tests/subscription.ts" | ||
"test-integration-general": "mocha -r ts-node/register tests/integration/general.ts", | ||
"test-integration-cloud-account": "mocha -r ts-node/register tests/integration/cloud-account.ts", | ||
"test-integration-database": "mocha -r ts-node/register tests/integration/database.ts", | ||
"test-integration-subscription": "mocha -r ts-node/register tests/integration/subscription.ts", | ||
"test-integration-cleanup": "mocha -r ts-node/register tests/integration/cleanup.ts", | ||
"test-unit-cycle": "mocha -r ts-node/register tests/unit/*", | ||
"test-unit-general": "mocha -r ts-node/register tests/unit/general.ts", | ||
"test-unit-cloud-account": "mocha -r ts-node/register tests/unit/cloud-account.ts", | ||
"test-unit-subscription": "mocha -r ts-node/register tests/unit/subscription.ts", | ||
"test-unit-database": "mocha -r ts-node/register tests/unit/database.ts" | ||
}, | ||
@@ -35,5 +40,6 @@ "keywords": [ | ||
"@types/chai": "^4.2.7", | ||
"@types/mocha": "^7.0.1", | ||
"@types/node": "^13.1.1", | ||
"@types/mocha": "^7.0.1", | ||
"chai": "^4.2.0", | ||
"dmock-server": "^1.0.7", | ||
"mocha": "^7.0.1", | ||
@@ -40,0 +46,0 @@ "ts-node": "^8.5.4", |
@@ -18,6 +18,9 @@ # rl-cloud-api-sdk | ||
//Getting account information | ||
const accountInformation: { [string:key]: any } = await cloudAPIClient.getAccountInformation(); | ||
const accountInformation = await cloudAPIClient.getAccountInformation(); | ||
``` | ||
All the API calls from the official Swagger documentation are covered in the SDK | ||
(https://api.redislabs.com/v1/swagger-ui.html). | ||
(https://api.redislabs.com/v1/swagger-ui.html). | ||
![Integration testings](https://github.com/danitseitlin/rl-cloud-api-sdk/workflows/Integration%20testings/badge.svg) | ||
![Unit testing](https://github.com/danitseitlin/rl-cloud-api-sdk/workflows/Unit%20testing/badge.svg) |
26
66874
9
19
1365