Skip to content

Latest commit

 

History

History
460 lines (421 loc) · 36.3 KB

README.md

File metadata and controls

460 lines (421 loc) · 36.3 KB

server

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>server</artifactId>
	<version>1.1.3</version>
	<scope>compile</scope>
</dependency>

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

  • target/server-1.1.3.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.server.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);
		AddMemberServerImageSharingPermissionRequest addMemberServerImageSharingPermissionRequest = new AddMemberServerImageSharingPermissionRequest(); // AddMemberServerImageSharingPermissionRequest | addMemberServerImageSharingPermissionRequest
		try {
			// Handler Successful response
			ApiResponse<AddMemberServerImageSharingPermissionResponse> result = apiInstance.addMemberServerImageSharingPermissionGet(addMemberServerImageSharingPermissionRequest);
		} 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/server/v2

Class Method HTTP request Description
V2Api addMemberServerImageSharingPermissionGet GET /addMemberServerImageSharingPermission
V2Api addMemberServerImageSharingPermissionPost POST /addMemberServerImageSharingPermission
V2Api addNasVolumeAccessControlGet GET /addNasVolumeAccessControl
V2Api addNasVolumeAccessControlPost POST /addNasVolumeAccessControl
V2Api addPortForwardingRulesGet GET /addPortForwardingRules
V2Api addPortForwardingRulesPost POST /addPortForwardingRules
V2Api associatePublicIpWithServerInstanceGet GET /associatePublicIpWithServerInstance
V2Api associatePublicIpWithServerInstancePost POST /associatePublicIpWithServerInstance
V2Api attachBlockStorageInstanceGet GET /attachBlockStorageInstance
V2Api attachBlockStorageInstancePost POST /attachBlockStorageInstance
V2Api attachNetworkInterfaceGet GET /attachNetworkInterface
V2Api attachNetworkInterfacePost POST /attachNetworkInterface
V2Api changeBlockStorageVolumeSizeGet GET /changeBlockStorageVolumeSize
V2Api changeBlockStorageVolumeSizePost POST /changeBlockStorageVolumeSize
V2Api changeNasVolumeSizeGet GET /changeNasVolumeSize
V2Api changeNasVolumeSizePost POST /changeNasVolumeSize
V2Api changeNasVolumeSnapshotConfigurationGet GET /changeNasVolumeSnapshotConfiguration
V2Api changeNasVolumeSnapshotConfigurationPost POST /changeNasVolumeSnapshotConfiguration
V2Api changeServerInstanceSpecGet GET /changeServerInstanceSpec
V2Api changeServerInstanceSpecPost POST /changeServerInstanceSpec
V2Api createBlockStorageInstanceGet GET /createBlockStorageInstance
V2Api createBlockStorageInstancePost POST /createBlockStorageInstance
V2Api createBlockStorageSnapshotInstanceGet GET /createBlockStorageSnapshotInstance
V2Api createBlockStorageSnapshotInstancePost POST /createBlockStorageSnapshotInstance
V2Api createInstanceTagsGet GET /createInstanceTags
V2Api createInstanceTagsPost POST /createInstanceTags
V2Api createLoginKeyGet GET /createLoginKey
V2Api createLoginKeyPost POST /createLoginKey
V2Api createMemberServerImageGet GET /createMemberServerImage
V2Api createMemberServerImagePost POST /createMemberServerImage
V2Api createNasVolumeInstanceGet GET /createNasVolumeInstance
V2Api createNasVolumeInstancePost POST /createNasVolumeInstance
V2Api createNasVolumeSnapshotGet GET /createNasVolumeSnapshot
V2Api createNasVolumeSnapshotPost POST /createNasVolumeSnapshot
V2Api createNetworkInterfaceGet GET /createNetworkInterface
V2Api createNetworkInterfacePost POST /createNetworkInterface
V2Api createPublicIpInstanceGet GET /createPublicIpInstance
V2Api createPublicIpInstancePost POST /createPublicIpInstance
V2Api createServerInstancesGet GET /createServerInstances
V2Api createServerInstancesPost POST /createServerInstances
V2Api deleteBlockStorageInstancesGet GET /deleteBlockStorageInstances
V2Api deleteBlockStorageInstancesPost POST /deleteBlockStorageInstances
V2Api deleteBlockStorageSnapshotInstancesGet GET /deleteBlockStorageSnapshotInstances
V2Api deleteBlockStorageSnapshotInstancesPost POST /deleteBlockStorageSnapshotInstances
V2Api deleteInstanceTagsGet GET /deleteInstanceTags
V2Api deleteInstanceTagsPost POST /deleteInstanceTags
V2Api deleteLoginKeyGet GET /deleteLoginKey
V2Api deleteLoginKeyPost POST /deleteLoginKey
V2Api deleteMemberServerImagesGet GET /deleteMemberServerImages
V2Api deleteMemberServerImagesPost POST /deleteMemberServerImages
V2Api deleteNasVolumeInstanceGet GET /deleteNasVolumeInstance
V2Api deleteNasVolumeInstancePost POST /deleteNasVolumeInstance
V2Api deleteNasVolumeSnapshotGet GET /deleteNasVolumeSnapshot
V2Api deleteNasVolumeSnapshotPost POST /deleteNasVolumeSnapshot
V2Api deleteNetworkInterfaceGet GET /deleteNetworkInterface
V2Api deleteNetworkInterfacePost POST /deleteNetworkInterface
V2Api deletePortForwardingRulesGet GET /deletePortForwardingRules
V2Api deletePortForwardingRulesPost POST /deletePortForwardingRules
V2Api deletePublicIpInstancesGet GET /deletePublicIpInstances
V2Api deletePublicIpInstancesPost POST /deletePublicIpInstances
V2Api detachBlockStorageInstancesGet GET /detachBlockStorageInstances
V2Api detachBlockStorageInstancesPost POST /detachBlockStorageInstances
V2Api detachNetworkInterfaceGet GET /detachNetworkInterface
V2Api detachNetworkInterfacePost POST /detachNetworkInterface
V2Api disassociatePublicIpFromServerInstanceGet GET /disassociatePublicIpFromServerInstance
V2Api disassociatePublicIpFromServerInstancePost POST /disassociatePublicIpFromServerInstance
V2Api getAccessControlGroupListGet GET /getAccessControlGroupList
V2Api getAccessControlGroupListPost POST /getAccessControlGroupList
V2Api getAccessControlGroupServerInstanceListGet GET /getAccessControlGroupServerInstanceList
V2Api getAccessControlGroupServerInstanceListPost POST /getAccessControlGroupServerInstanceList
V2Api getAccessControlRuleListGet GET /getAccessControlRuleList
V2Api getAccessControlRuleListPost POST /getAccessControlRuleList
V2Api getBlockStorageInstanceListGet GET /getBlockStorageInstanceList
V2Api getBlockStorageInstanceListPost POST /getBlockStorageInstanceList
V2Api getBlockStorageSnapshotInstanceListGet GET /getBlockStorageSnapshotInstanceList
V2Api getBlockStorageSnapshotInstanceListPost POST /getBlockStorageSnapshotInstanceList
V2Api getInitScriptListGet GET /getInitScriptList
V2Api getInitScriptListPost POST /getInitScriptList
V2Api getInstanceTagListGet GET /getInstanceTagList
V2Api getInstanceTagListPost POST /getInstanceTagList
V2Api getLoginKeyListGet GET /getLoginKeyList
V2Api getLoginKeyListPost POST /getLoginKeyList
V2Api getMemberServerImageListGet GET /getMemberServerImageList
V2Api getMemberServerImageListPost POST /getMemberServerImageList
V2Api getNasVolumeAccessControlRuleListGet GET /getNasVolumeAccessControlRuleList
V2Api getNasVolumeAccessControlRuleListPost POST /getNasVolumeAccessControlRuleList
V2Api getNasVolumeInstanceListGet GET /getNasVolumeInstanceList
V2Api getNasVolumeInstanceListPost POST /getNasVolumeInstanceList
V2Api getNasVolumeInstanceRatingListGet GET /getNasVolumeInstanceRatingList
V2Api getNasVolumeInstanceRatingListPost POST /getNasVolumeInstanceRatingList
V2Api getNasVolumeSnapshotConfigurationHistoryListGet GET /getNasVolumeSnapshotConfigurationHistoryList
V2Api getNasVolumeSnapshotConfigurationHistoryListPost POST /getNasVolumeSnapshotConfigurationHistoryList
V2Api getNasVolumeSnapshotListGet GET /getNasVolumeSnapshotList
V2Api getNasVolumeSnapshotListPost POST /getNasVolumeSnapshotList
V2Api getNetworkInterfaceListGet GET /getNetworkInterfaceList
V2Api getNetworkInterfaceListPost POST /getNetworkInterfaceList
V2Api getPortForwardingConfigurationListGet GET /getPortForwardingConfigurationList
V2Api getPortForwardingConfigurationListPost POST /getPortForwardingConfigurationList
V2Api getPortForwardingRuleListGet GET /getPortForwardingRuleList
V2Api getPortForwardingRuleListPost POST /getPortForwardingRuleList
V2Api getPrivateSubnetInstanceListGet GET /getPrivateSubnetInstanceList
V2Api getPrivateSubnetInstanceListPost POST /getPrivateSubnetInstanceList
V2Api getPublicIpInstanceListGet GET /getPublicIpInstanceList
V2Api getPublicIpInstanceListPost POST /getPublicIpInstanceList
V2Api getPublicIpTargetServerInstanceListGet GET /getPublicIpTargetServerInstanceList
V2Api getPublicIpTargetServerInstanceListPost POST /getPublicIpTargetServerInstanceList
V2Api getRaidListGet GET /getRaidList
V2Api getRaidListPost POST /getRaidList
V2Api getRegionListGet GET /getRegionList
V2Api getRegionListPost POST /getRegionList
V2Api getRootPasswordGet GET /getRootPassword
V2Api getRootPasswordPost POST /getRootPassword
V2Api getRootPasswordServerInstanceListGet GET /getRootPasswordServerInstanceList
V2Api getRootPasswordServerInstanceListPost POST /getRootPasswordServerInstanceList
V2Api getServerImageProductListGet GET /getServerImageProductList
V2Api getServerImageProductListPost POST /getServerImageProductList
V2Api getServerInstanceListGet GET /getServerInstanceList
V2Api getServerInstanceListPost POST /getServerInstanceList
V2Api getServerProductListGet GET /getServerProductList
V2Api getServerProductListPost POST /getServerProductList
V2Api getZoneListGet GET /getZoneList
V2Api getZoneListPost POST /getZoneList
V2Api importLoginKeyGet GET /importLoginKey
V2Api importLoginKeyPost POST /importLoginKey
V2Api interruptServerInstanceGet GET /interruptServerInstance
V2Api interruptServerInstancePost POST /interruptServerInstance
V2Api rebootServerInstancesGet GET /rebootServerInstances
V2Api rebootServerInstancesPost POST /rebootServerInstances
V2Api recreateServerInstanceGet GET /recreateServerInstance
V2Api recreateServerInstancePost POST /recreateServerInstance
V2Api removeMemberServerImageSharingPermissionGet GET /removeMemberServerImageSharingPermission
V2Api removeMemberServerImageSharingPermissionPost POST /removeMemberServerImageSharingPermission
V2Api removeNasVolumeAccessControlGet GET /removeNasVolumeAccessControl
V2Api removeNasVolumeAccessControlPost POST /removeNasVolumeAccessControl
V2Api replaceServerInstanceAssociatedWithPublicIpGet GET /replaceServerInstanceAssociatedWithPublicIp
V2Api replaceServerInstanceAssociatedWithPublicIpPost POST /replaceServerInstanceAssociatedWithPublicIp
V2Api restoreNasVolumeWithSnapshotGet GET /restoreNasVolumeWithSnapshot
V2Api restoreNasVolumeWithSnapshotPost POST /restoreNasVolumeWithSnapshot
V2Api setMemberServerImageSharingPermissionGet GET /setMemberServerImageSharingPermission
V2Api setMemberServerImageSharingPermissionPost POST /setMemberServerImageSharingPermission
V2Api setNasVolumeAccessControlGet GET /setNasVolumeAccessControl
V2Api setNasVolumeAccessControlPost POST /setNasVolumeAccessControl
V2Api setNasVolumeReturnProtectionGet GET /setNasVolumeReturnProtection
V2Api setNasVolumeReturnProtectionPost POST /setNasVolumeReturnProtection
V2Api setProtectServerTerminationGet GET /setProtectServerTermination
V2Api setProtectServerTerminationPost POST /setProtectServerTermination
V2Api startServerInstancesGet GET /startServerInstances
V2Api startServerInstancesPost POST /startServerInstances
V2Api stopServerInstancesGet GET /stopServerInstances
V2Api stopServerInstancesPost POST /stopServerInstances
V2Api terminateServerInstancesGet GET /terminateServerInstances
V2Api terminateServerInstancesPost POST /terminateServerInstances

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