Configuring the API access environment (Windows)

It is necessary to execute cURL commands when using APIs to access the K5 IaaS. However, in Windows, cURL is not provided as a built-in OS function. This section explains an example procedure in which Cygwin is used to construct an execution environment to enable the use of cURL commands in a Windows environment. Although numerous cases of use of Cygwin have been reported, operations using Cygwin are not guaranteed. Perform these operations at your own risk.

  1. Install Cygwin

    Download the installer

    Download the Cygwin installer from the following URL. Download the installer that is compatible with the Windows environment that you are using.

    https://cygwin.com/install.html

    When using a 64-bit OS, setup-x86_64.exe (Ver2.882)

    When using a 32-bit OS, setup-x86.exe (Ver2.882)

  2. Download and install packages

    Execute the downloaded installer.

    Execute installation over the Internet. "Install from Internet" is selected by default. Leave this selected, and click [Next].

  3. Specify the route directory and users of Cygwin

    If you have no particular root directory in mind, leave the default value unchanged. For the users who can use Cygwin, select "All Users (RECOMMENDED)", and then click [Next].

  4. Specify the storage directory for packages to install

    If you have no particular directory in mind, leave the default value unchanged. Click [Next].

  5. Specify the Internet connection method

    When performing installation over the Internet in an environment in which it is necessary to specify a proxy in order to connect to an external network, select either "Use System Proxy Settings" or "Use HTTP/FTP Proxy". In this example procedure, "Use System Proxy Settings" is selected. After selecting the desired method, click [Next].

    - Direct Connection (Connect without specifying a proxy)

    - Use System Proxy Settings (Use the proxy settings specified in the Web browser)

    The settings in "Internet Options" > [Connections] tab > [LAN settings] > "Proxy server" are used

    - Use HTTP/FTP Proxy (Specify a proxy directly)

  6. Choose a download site

    A list of download sites is displayed. Select a site, and then click [Next].

  7. Enter "curl" in the search field for packages to install

    For "Net" - "curl", select version 7.49 or later. In the screenshot below, 7.56.1-1 is selected.

    Clicking "Skip" displays the version number that will be installed.

  8. Enter "jq" in the search field for packages to install

    For "Text" - "jq", select version 1.5-1 or later. In the screenshot below, 1.5-3 is selected.

    Clicking "Skip" displays the version number that will be installed.

  9. Enter "libxml2" in the search field for packages to install

    For "Libs" - "libxml2", select version 2.9.3-1 or later. In the screenshot below, 2.9.4-2 is selected.

    Install the "libxml2:GNOME XML library(runtime)" package.

    Clicking "Skip" displays the version number that will be installed. Click [Next].

  10. The screen for confirming dependencies is displayed. Click [Next].

  11. Click "Finish" to close the installer.

    Confirm that "Create icon on Desktop" is checked. A [Cygwin64 Terminal] icon is created on the desktop.

  12. Set the language of the Cygwin Terminal

    Double click the [Cygwin64 Terminal] icon that was created on the desktop to launch the terminal.

    Right-click the title bar of the terminal, and select "Options".

    In "Text", set "Locale" to [en_US] or [ja_JP], and set "Character set" to [UTF-8].

  13. Confirm that curl, jq, and xmllint have been installed

    Launch "Cygwin64 Terminal", and then execute the following commands.

    $ curl --version
    $ jq --version
    $ xmllint --version

    * If any of the above commands cannot be found, run the installer again, and reinstall the relevant package.

  14. Configure the proxy settings for curl

    If it is necessary to issue curl commands through a proxy, it is necessary to include the information of that proxy in the initial configuration file for curl.

    Create the file ".curlrc" in the directory "C:\cygwin64\home\<userName>" using a text editor. Be sure to use LF (UNIX line feed) for the line feed code in this file.

    Enter the following two lines of text in ".curlrc".

    proxy="<proxyServerName>:<portNumber>"
    proxy-user="<userName>:<password>"