Skip to content

Latest commit

 

History

History
168 lines (129 loc) · 6.94 KB

README.md

File metadata and controls

168 lines (129 loc) · 6.94 KB

cdn

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>cdn</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/cdn-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.cdn.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);
		GetCdnPlusInstanceListRequest getCdnPlusInstanceListRequest = new GetCdnPlusInstanceListRequest(); // GetCdnPlusInstanceListRequest | getCdnPlusInstanceListRequest
		try {
			// Handler Successful response
			ApiResponse<GetCdnPlusInstanceListResponse> result = apiInstance.getCdnPlusInstanceListGet(getCdnPlusInstanceListRequest);
		} 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/cdn/v2

Class Method HTTP request Description
V2Api getCdnPlusInstanceListGet GET /getCdnPlusInstanceList
V2Api getCdnPlusInstanceListPost POST /getCdnPlusInstanceList
V2Api getCdnPlusMonitoringDataGet GET /getCdnPlusMonitoringData
V2Api getCdnPlusMonitoringDataPost POST /getCdnPlusMonitoringData
V2Api getCdnPlusPurgeHistoryListGet GET /getCdnPlusPurgeHistoryList
V2Api getCdnPlusPurgeHistoryListPost POST /getCdnPlusPurgeHistoryList
V2Api getCdnPlusUsageDataGet GET /getCdnPlusUsageData
V2Api getCdnPlusUsageDataPost POST /getCdnPlusUsageData
V2Api getGlobalCdnInstanceListGet GET /getGlobalCdnInstanceList
V2Api getGlobalCdnInstanceListPost POST /getGlobalCdnInstanceList
V2Api getGlobalCdnMonitoringDataGet GET /getGlobalCdnMonitoringData
V2Api getGlobalCdnMonitoringDataPost POST /getGlobalCdnMonitoringData
V2Api getGlobalCdnPurgeHistoryListGet GET /getGlobalCdnPurgeHistoryList
V2Api getGlobalCdnPurgeHistoryListPost POST /getGlobalCdnPurgeHistoryList
V2Api getGlobalCdnUsageDataGet GET /getGlobalCdnUsageData
V2Api getGlobalCdnUsageDataPost POST /getGlobalCdnUsageData
V2Api requestCdnPlusPurgeGet GET /requestCdnPlusPurge
V2Api requestCdnPlusPurgePost POST /requestCdnPlusPurge
V2Api requestGlobalCdnPurgeGet GET /requestGlobalCdnPurge
V2Api requestGlobalCdnPurgePost POST /requestGlobalCdnPurge

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