createInitScript

Prev Next

Can be used in a VPC environment.

Overview

Create an initialization script.

Request

Request parameter

Parameter Name Required Status Type Restrictions Description
regionCode No String Region Code
You can decide the region where the initialization script will be created.
The regionCode can be obtained through the getRegionList action.
Default: Select the first region of the getRegionList query results.
initScriptName No String Min : 3, Max : 30
Only English, numbers, and special characters "-" are allowed, and it must start with English.
It must end with an alphabet letter or number.
The name of the initialization script to be created
Default: Naver Cloud Platform automatically assigns it.
osTypeCode No String OS type code
This determines the OS environment in which the initialization script will be executed.
Options : LNX (LINUX) | WND (WINDOWS)
Default : LNX
initScriptContent Yes String Min : 0, Max : 1024 KBytes The content of the initialization script
* In the Linux environment, the scripts such as Python, Perl and Shell can be used.
- However, you must specify the path of the script you want to execute in the form of #!/usr/bin/env python, #!/bin/perl and #!/bin/bash on the first line.
* In the Windows environment, you can only write the Visual Basic script.
- However, the script content must be written in English.
initScriptDescription No String Min : 0, Max : 1000 Bytes The description about the initialization script to be created
responseFormatType No String Format type for the response result
Options : xml | json
Default : xml

Response

Response data type

  • InitScriptList type
InitScriptList extends CommonResponse
private Integer totalRows;
private List<InitScript> initScriptList = new ArrayList<>();
InitScript
private String initScriptNo;
private String initScriptName;
private Date createDate;
private String initScriptDescription;
private String initScriptContent;
private CommonCode osType;

Example

Request example

ncloud vserver createInitScript --regionCode KR --initScriptName test-*** --osTypeCode LNX --initScriptContent "#!/bin/bash"

Response example

<createInitScriptResponse>
  <requestId></requestId>
  <returnCode>0</returnCode>
  <returnMessage>success</returnMessage>
  <totalRows>1</totalRows>
  <initScriptList>
    <initScript>
      <initScriptNo>***44</initScriptNo>
      <initScriptName>test-***</initScriptName>
      <createDate>2020-08-20T15:03:37+0900</createDate>
      <initScriptDescription></initScriptDescription>
      <initScriptContent>#!/bin/bash</initScriptContent>
      <osType>
        <code>LNX</code>
        <codeName>LINUX</codeName>
      </osType>
    </initScript>
  </initScriptList>
</createInitScriptResponse>