Building the API client library requires Maven to be installed.
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.
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>
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/server-1.1.3.jar
- target/lib/*.jar
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();
}
}
}
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 |
- AccessControlGroup
- AccessControlRule
- AccessControlRuleParameter
- AddMemberServerImageSharingPermissionRequest
- AddMemberServerImageSharingPermissionResponse
- AddNasVolumeAccessControlRequest
- AddNasVolumeAccessControlResponse
- AddPortForwardingRulesRequest
- AddPortForwardingRulesResponse
- AssociatePublicIpWithServerInstanceRequest
- AssociatePublicIpWithServerInstanceResponse
- AttachBlockStorageInstanceRequest
- AttachBlockStorageInstanceResponse
- AttachNetworkInterfaceRequest
- AttachNetworkInterfaceResponse
- BlockDevicePartition
- BlockStorageInstance
- BlockStorageSnapshotInstance
- ChangeBlockStorageVolumeSizeRequest
- ChangeBlockStorageVolumeSizeResponse
- ChangeNasVolumeSizeRequest
- ChangeNasVolumeSizeResponse
- ChangeNasVolumeSnapshotConfigurationRequest
- ChangeNasVolumeSnapshotConfigurationResponse
- ChangeServerInstanceSpecRequest
- ChangeServerInstanceSpecResponse
- CommonCode
- CreateBlockStorageInstanceRequest
- CreateBlockStorageInstanceResponse
- CreateBlockStorageSnapshotInstanceRequest
- CreateBlockStorageSnapshotInstanceResponse
- CreateInstanceTagsRequest
- CreateInstanceTagsResponse
- CreateLoginKeyRequest
- CreateLoginKeyResponse
- CreateMemberServerImageRequest
- CreateMemberServerImageResponse
- CreateNasVolumeInstanceRequest
- CreateNasVolumeInstanceResponse
- CreateNasVolumeSnapshotRequest
- CreateNasVolumeSnapshotResponse
- CreateNetworkInterfaceRequest
- CreateNetworkInterfaceResponse
- CreatePublicIpInstanceRequest
- CreatePublicIpInstanceResponse
- CreateServerInstancesRequest
- CreateServerInstancesResponse
- DeleteBlockStorageInstancesRequest
- DeleteBlockStorageInstancesResponse
- DeleteBlockStorageSnapshotInstancesRequest
- DeleteBlockStorageSnapshotInstancesResponse
- DeleteInstanceTagsRequest
- DeleteInstanceTagsResponse
- DeleteLoginKeyRequest
- DeleteLoginKeyResponse
- DeleteMemberServerImagesRequest
- DeleteMemberServerImagesResponse
- DeleteNasVolumeInstanceRequest
- DeleteNasVolumeInstanceResponse
- DeleteNasVolumeSnapshotRequest
- DeleteNasVolumeSnapshotResponse
- DeleteNetworkInterfaceRequest
- DeleteNetworkInterfaceResponse
- DeletePortForwardingRulesRequest
- DeletePortForwardingRulesResponse
- DeletePublicIpInstancesRequest
- DeletePublicIpInstancesResponse
- DetachBlockStorageInstancesRequest
- DetachBlockStorageInstancesResponse
- DetachNetworkInterfaceRequest
- DetachNetworkInterfaceResponse
- DisassociatePublicIpFromServerInstanceRequest
- DisassociatePublicIpFromServerInstanceResponse
- GetAccessControlGroupListRequest
- GetAccessControlGroupListResponse
- GetAccessControlGroupServerInstanceListRequest
- GetAccessControlGroupServerInstanceListResponse
- GetAccessControlRuleListRequest
- GetAccessControlRuleListResponse
- GetBlockStorageInstanceListRequest
- GetBlockStorageInstanceListResponse
- GetBlockStorageSnapshotInstanceListRequest
- GetBlockStorageSnapshotInstanceListResponse
- GetInitScriptListRequest
- GetInitScriptListResponse
- GetInstanceTagListRequest
- GetInstanceTagListResponse
- GetLoginKeyListRequest
- GetLoginKeyListResponse
- GetMemberServerImageListRequest
- GetMemberServerImageListResponse
- GetNasVolumeAccessControlRuleListRequest
- GetNasVolumeAccessControlRuleListResponse
- GetNasVolumeInstanceListRequest
- GetNasVolumeInstanceListResponse
- GetNasVolumeInstanceRatingListRequest
- GetNasVolumeInstanceRatingListResponse
- GetNasVolumeSnapshotConfigurationHistoryListRequest
- GetNasVolumeSnapshotConfigurationHistoryListResponse
- GetNasVolumeSnapshotListRequest
- GetNasVolumeSnapshotListResponse
- GetNetworkInterfaceListRequest
- GetNetworkInterfaceListResponse
- GetPortForwardingConfigurationListRequest
- GetPortForwardingConfigurationListResponse
- GetPortForwardingRuleListRequest
- GetPortForwardingRuleListResponse
- GetPrivateSubnetInstanceListRequest
- GetPrivateSubnetInstanceListResponse
- GetPublicIpInstanceListRequest
- GetPublicIpInstanceListResponse
- GetPublicIpTargetServerInstanceListRequest
- GetPublicIpTargetServerInstanceListResponse
- GetRaidListRequest
- GetRaidListResponse
- GetRegionListRequest
- GetRegionListResponse
- GetRootPasswordRequest
- GetRootPasswordResponse
- GetRootPasswordServerInstanceListRequest
- GetRootPasswordServerInstanceListResponse
- GetServerImageProductListRequest
- GetServerImageProductListResponse
- GetServerInstanceListRequest
- GetServerInstanceListResponse
- GetServerProductListRequest
- GetServerProductListResponse
- GetZoneListRequest
- GetZoneListResponse
- ImportLoginKeyRequest
- ImportLoginKeyResponse
- InitScript
- InstanceTag
- InstanceTagParameter
- InterruptServerInstanceRequest
- InterruptServerInstanceResponse
- LoginKey
- MemberServerImage
- NasVolumeAccessControlRule
- NasVolumeInstance
- NasVolumeInstanceCustomIp
- NasVolumeInstanceRating
- NasVolumeSnapshot
- NasVolumeSnapshotConfigurationHistory
- NetworkInterface
- PortForwardingConfiguration
- PortForwardingRule
- PortForwardingRuleParameter
- PrivateSubnetInstance
- Product
- PublicIpInstance
- Raid
- RebootServerInstancesRequest
- RebootServerInstancesResponse
- RecreateServerInstanceRequest
- RecreateServerInstanceResponse
- Region
- RemoveMemberServerImageSharingPermissionRequest
- RemoveMemberServerImageSharingPermissionResponse
- RemoveNasVolumeAccessControlRequest
- RemoveNasVolumeAccessControlResponse
- ReplaceServerInstanceAssociatedWithPublicIpRequest
- ReplaceServerInstanceAssociatedWithPublicIpResponse
- RestoreNasVolumeWithSnapshotRequest
- RestoreNasVolumeWithSnapshotResponse
- RootPasswordServerInstance
- RootPasswordServerInstanceParameter
- ServerInstance
- SetMemberServerImageSharingPermissionRequest
- SetMemberServerImageSharingPermissionResponse
- SetNasVolumeAccessControlRequest
- SetNasVolumeAccessControlResponse
- SetNasVolumeReturnProtectionRequest
- SetNasVolumeReturnProtectionResponse
- SetProtectServerTerminationRequest
- SetProtectServerTerminationResponse
- StartServerInstancesRequest
- StartServerInstancesResponse
- StopServerInstancesRequest
- StopServerInstancesResponse
- TerminateServerInstancesRequest
- TerminateServerInstancesResponse
- Zone
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.