github.com/NaverCloudPlatform/ncloud-sdk-go-v2@v1.6.13/README.md (about)

     1  # ncloud-sdk-go-v2
     2  
     3  ncloud-sdk-go-v2 is the official Naver Cloud Platform SDK for the Go programming language.
     4  
     5  ### Installing
     6  
     7  ```
     8  go get github.com/NaverCloudPlatform/ncloud-sdk-go-v2
     9  ```
    10  
    11  ### Example
    12  
    13  ```
    14  package main
    15  
    16  import (
    17  	"log"
    18  
    19  	"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
    20  	"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
    21  )
    22  
    23  func main() {
    24  
    25  	apiKeys := ncloud.Keys()
    26  	client := server.NewAPIClient(server.NewConfiguration(apiKeys))
    27  
    28  	// Create server instance
    29  	req := server.CreateServerInstancesRequest{
    30  		ServerImageProductCode:     ncloud.String("SPSW0LINUX000031"),
    31  		ServerProductCode:          ncloud.String("SPSVRSTAND000049"),
    32  		UserData:                   ncloud.String("#!/bin/sh\nyum -y install httpd"),
    33  		IsProtectServerTermination: ncloud.Bool(false),
    34  		ServerCreateCount:          ncloud.Int32(1),
    35  	}
    36  
    37  
    38  	if r, err := client.V2Api.CreateServerInstances(&req); err != nil {
    39  		log.Println(err)
    40  	} else {
    41  		sList := r.ServerInstanceList
    42  		log.Println(ncloud.StringValue(r.RequestId))
    43  		log.Println(ncloud.StringValue(sList[0].ServerInstanceNo))
    44  		log.Println(ncloud.StringValue(sList[0].ServerName))
    45  	}
    46  }
    47  ```
    48  
    49  If credentials (apiKeys) are not specified, the default credential provider chain is used. The default credential provider chain looks for credentials in the following order:
    50  
    51  1. Environment Variable: Use the NCLOUD_ACCESS_KEY_ID (or NCLOUD_ACCESS_KEY) and NCLOUD_SECRET_KEY (or NCLOUD_SECRET_ACCESS_KEY) environment variables.
    52  2. Config file: Use configuration file. The path to the configuration file is .ncloud/configure in the HOME directory.
    53  3. Server Role: Used on VPC Server instances, and delivered through the ncloud metadata api. Server Role can be set in the NCP Sub Account console.
    54  
    55  
    56  ## Documentation for individual modules
    57  
    58  | Services       | Documentation                                       |
    59  | -------------- | --------------------------------------------------- |
    60  | _Autoscaling(Classic)_  | [**Autoscaling**](services/autoscaling/README.md)   |
    61  | _Autoscaling(VPC)_      | [**Autoscaling(VPC)**](services/vautoscaling/README.md)           |
    62  | _CDN(All)_          | [**CDN**](services/cdn/README.md)                   |
    63  | _Cloud Data Streaming Service(VPC)_ | [**Cloud Data Streaming Service(VPC)**](services/vcdss/README.md) |
    64  | _CloudDB(Classic)_      | [**CloudDB**](services/clouddb/README.md)           |
    65  | _Cloud DB For MySQL(VPC)_ | [**Cloud DB For MySQL(VPC)**](services/vmysql/README.md) |
    66  | _Cloud DB For MSSQL(VPC)_ | [**Cloud DB For MSSQL(VPC)**](services/vmssql/README.md) |
    67  | _Cloud DB For Redis(VPC)_ | [**Cloud DB For Redis(VPC)**](services/vredis/README.md) |
    68  | _Cloud DB For MongoDB(VPC)_ | [**Cloud DB For MongoDB(VPC)**](services/vmongodb/README.md) |
    69  | _Cloud Hadoop(VPC)_ | [**Cloud Hadoop(VPC)**](services/vhadoop/README.md) |
    70  | _Kubernetes Service(VPC)_ | [**NKS(VPC)**](services/vnks/README.md) |
    71  | _Loadbalancer(Classic)_ | [**Loadbalancer**](services/loadbalancer/README.md) |
    72  | _Loadbalancer(VPC)_      | [**Loadbalancer(VPC)**](services/vloadbalancer/README.md)           |
    73  | _Nas(VPC)_      | [**Nas(VPC)**](services/vnas/README.md)           |
    74  | _Search Engine Service(VPC)_        | [**Search Engine Service(VPC)**](services/vses2/README.md)         |
    75  | _Server(Classic)_       | [**Server**](services/server/README.md)             |
    76  | _Server(VPC)_      | [**Server(VPC)**](services/vserver/README.md)           |
    77  | _SourceBuild(All)_ | [**SourceBuild**](services/sourcebuild/README.md) |
    78  | _SourceCommit(All)_ | [**SourceCommit**](services/sourcecommit/README.md) |
    79  | _SourceDeploy(VPC)_ | [**SourceDeploy(VPC)**](services/vsourcedeploy/README.md) |
    80  | _SourcePipeline(Classic)_ | [**SourcePipeline**](services/sourcepipeline/README.md) |
    81  | _SourcePipeline(VPC)_ | [**SourcePipeline(VPC)**](services/vsourcepipeline/README.md) |
    82  | _VPC(VPC)_      | [**VPC**](services/vpc/README.md)           |
    83  
    84  ### License
    85  
    86  ```
    87  Copyright (c) 2021 NAVER Cloud Corp.
    88  
    89  Permission is hereby granted, free of charge, to any person obtaining a copy
    90  of this software and associated documentation files (the "Software"), to deal
    91  in the Software without restriction, including without limitation the rights
    92  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    93  copies of the Software, and to permit persons to whom the Software is
    94  furnished to do so, subject to the following conditions:
    95  
    96  The above copyright notice and this permission notice shall be included in
    97  all copies or substantial portions of the Software.
    98  
    99  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   100  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   101  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
   102  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   103  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   104  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   105  THE SOFTWARE.
   106  ```