Skip to content

Latest commit

 

History

History
219 lines (180 loc) · 11.3 KB

README.md

File metadata and controls

219 lines (180 loc) · 11.3 KB

clouddb

Requirements

Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:

mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
	<groupId>com.ncloud</groupId>
	<artifactId>clouddb</artifactId>
	<version>1.1.1</version>
	<scope>compile</scope>
</dependency>

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

  • target/clouddb-1.1.1.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and create a credentials properties file.

type=iam
apiKey=your-api-key
accessKey=your-access-key
secretKey=your-secret-key

And execute the following Java code:

import java.io.InputStream;
import java.util.List;
import java.util.Map;

import com.ncloud.ApiClient;
import com.ncloud.ApiResponse;
import com.ncloud.auth.PropertiesFileCredentialsProvider;
import com.ncloud.exception.ApiException;
import com.ncloud.exception.SdkException;
import com.ncloud.marshaller.FormMarshaller;
import com.ncloud.marshaller.JsonMarshaller;
import com.ncloud.marshaller.XmlMarshaller;
import com.ncloud.clouddb.model.*;

public class V2ApiExample {

	public static void main(String[] args) {
		ApiClient apiClient = new ApiClient.ApiClientBuilder()
			.addMarshaller(JsonMarshaller.getInstance())
			.addMarshaller(XmlMarshaller.getInstance())
			.addMarshaller(FormMarshaller.getInstance())
			.setCredentialsProvider(new PropertiesFileCredentialsProvider("your-credentials-properties-file"))
			.setLogging(true)
			.build();

		V2Api apiInstance = new V2Api(apiClient);
		CreateCloudDBInstanceRequest createCloudDBInstanceRequest = new CreateCloudDBInstanceRequest(); // CreateCloudDBInstanceRequest | createCloudDBInstanceRequest
		try {
			// Handler Successful response
			ApiResponse<CreateCloudDBInstanceResponse> result = apiInstance.createCloudDBInstanceGet(createCloudDBInstanceRequest);
		} catch (ApiException e) {
			// Handler Failed response
			int statusCode = e.getHttpStatusCode();
			Map<String, List<String>> responseHeaders = e.getHttpHeaders();
			InputStream byteStream = e.getByteStream();
			e.printStackTrace();
		} catch (SdkException e) {
			// Handle exceptions that occurred before communication with the server
			e.printStackTrace();
		}
	}
}

Documentation for API Endpoints

All URIs are relative to https://ncloud.apigw.ntruss.com/clouddb/v2

Class Method HTTP request Description
V2Api createCloudDBInstanceGet GET /createCloudDBInstance
V2Api createCloudDBInstancePost POST /createCloudDBInstance
V2Api deleteCloudDBServerInstanceGet GET /deleteCloudDBServerInstance
V2Api deleteCloudDBServerInstancePost POST /deleteCloudDBServerInstance
V2Api downloadDmsFileGet GET /downloadDmsFile
V2Api downloadDmsFilePost POST /downloadDmsFile
V2Api exportBackupToObjectStorageGet GET /exportBackupToObjectStorage
V2Api exportBackupToObjectStoragePost POST /exportBackupToObjectStorage
V2Api exportDbServerLogToObjectStorageGet GET /exportDbServerLogToObjectStorage
V2Api exportDbServerLogToObjectStoragePost POST /exportDbServerLogToObjectStorage
V2Api flushCloudDBInstanceGet GET /flushCloudDBInstance
V2Api flushCloudDBInstancePost POST /flushCloudDBInstance
V2Api getBackupListGet GET /getBackupList
V2Api getBackupListPost POST /getBackupList
V2Api getCloudDBBackupDetailListGet GET /getCloudDBBackupDetailList
V2Api getCloudDBBackupDetailListPost POST /getCloudDBBackupDetailList
V2Api getCloudDBConfigGroupListGet GET /getCloudDBConfigGroupList
V2Api getCloudDBConfigGroupListPost POST /getCloudDBConfigGroupList
V2Api getCloudDBImageProductListGet GET /getCloudDBImageProductList
V2Api getCloudDBImageProductListPost POST /getCloudDBImageProductList
V2Api getCloudDBInstanceListGet GET /getCloudDBInstanceList
V2Api getCloudDBInstanceListPost POST /getCloudDBInstanceList
V2Api getCloudDBProductListGet GET /getCloudDBProductList
V2Api getCloudDBProductListPost POST /getCloudDBProductList
V2Api getDbServerLogListGet GET /getDbServerLogList
V2Api getDbServerLogListPost POST /getDbServerLogList
V2Api getDmsOperationGet GET /getDmsOperation
V2Api getDmsOperationPost POST /getDmsOperation
V2Api getObjectStorageBackupListGet GET /getObjectStorageBackupList
V2Api getObjectStorageBackupListPost POST /getObjectStorageBackupList
V2Api rebootCloudDBServerInstanceGet GET /rebootCloudDBServerInstance
V2Api rebootCloudDBServerInstancePost POST /rebootCloudDBServerInstance
V2Api restoreDmsDatabaseGet GET /restoreDmsDatabase
V2Api restoreDmsDatabasePost POST /restoreDmsDatabase
V2Api restoreDmsTransactionLogGet GET /restoreDmsTransactionLog
V2Api restoreDmsTransactionLogPost POST /restoreDmsTransactionLog
V2Api setObjectStorageInfoGet GET /setObjectStorageInfo
V2Api setObjectStorageInfoPost POST /setObjectStorageInfo
V2Api uploadDmsFileGet GET /uploadDmsFile
V2Api uploadDmsFilePost POST /uploadDmsFile

Documentation for Models

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author