<commit_before>{{{
  "title": "CenturyLink Cloud Guide to CLI",
  "date": "02-13-2016",
  "author": "<NAME>",
  "attachments": [],
  "contentIsHTML": false
}}}
### Table of contents

* [Overview](#overview)
* [Prerequisites](#prerequisites)
* [Use Case Scenarios](#use-case-scenarios)
* [Installation of CenturyLink Cloud CLI](#installation-of-centurylink-cloud-cli)
* [READ commands](#read-commands)
* [Billing and Accounting](#billing-and-accounting)
* [Commands change the environment](#commands-change-the-environment)
* [Advanced usage](#advanced-usage)
* [Support](#support)

### Overview

There are two CLI interfaces available on CenturyLink Cloud, GO based
CLI for API v2 (explains here) and Python based CLI for API v1 and v2.

For accounts, users, groups, [API v1](//github.com/CenturyLinkCloud/clc-python-sdk/blob/master/README_CLI.md) provides the access to this information. For the rest of the data, [API v2](https://www.ctl.io/api-docs/v2/) can be used to access this information.

For detail usage of CLI v1 and download, please see its [GitHub
repository](//github.com/CenturyLinkCloud/clc-python-sdk/blob/master/README_CLI.md).
The windows CLI executable can be downloaded from
[here](//github.com/CenturyLinkCloud/clc-python-sdk/raw/master/src/dist/clc-cli.exe).

Comparison of the two CLI tools:

| CLI         |   Python            | Go                  |
| ---------   | ------------------- | -----------------   |
| API version | Mostly v1 (some v2) |         v2          |
| Resources     |  accounts           |   alert-policy      |
|             | billing             |  anti-affinity-policy |
|             | blueprints          |  autoscale-policy   |
|             | groups              | billing             |
|             | networks            | custom-fields       |
|             | queue               | data-center         |
|             | servers             | firewall-policy     |
|             | users               | group               |
|             |                     | load-balancer       |
|             |                     | load-balancer-pool  |
|             |                     | login               |
|             |                     | network             |
|             |                     | server              |
|             |                     | wait                |

The GO based CLI can be run on Mac OSX, Linux and Windows. For
download page, please see the [CenturyLink Cloud CLI GitHub release
page](//github.com/CenturyLinkCloud/clc-go-cli/releases).  
The Python based SDK is crossed platform, the CLI can be ran on any Python 2.7 environment.  There is a pre-complied Windows version of the CLI, it is available [here](https://github.com/CenturyLinkCloud/clc-python-sdk/raw/master/src/dist/clc-cli.exe).  A
The resources available on both tools will output similar results, at this time, certain functions are only available on API v1, hence the need of both tools to capture all the functionalities of the platform.

### Prerequisites
-   Access to the CenturyLink Cloud platform as an authorized user
-   Understanding of CenturyLink Cloud portal
-   Scripting knowledge will help on fully utilizing the CLI
-   Python 2.7 installed in the environment for Python based CLI
-   API user account [please see this KB for detail](https://www.ctl.io/knowledge-base/accounts-&-users/creating-users/)

### Use Case Scenarios
This tool enables system administrators to interface with CenturyLink Cloud without programming with the API or the using the Control Portal.  Automation can be achieved using scripting and other automation tools.

### Installation of CenturyLink Cloud CLI

***In order to make easy distintion between the two CLIs, clc-cli is the Python based tool and clc is the GO based tool.***

**Python Based CLI:**

Installation instruction is available [here](https://github.com/CenturyLinkCloud/clc-python-sdk).  If pip is installed, then the following command will installed the CenturyLink Cloud Python SDK and CLI:
```
pip install clc-sdk
```
For authentication, it can be several way, please see the [README page of the CLI](https://github.com/CenturyLinkCloud/clc-python-sdk/blob/master/README_CLI.md#authentication).  In order to use a system configuration file, a clc.ini (Windows) or clc_config (POSIX) needs to be created.  An example is shown below:
```
[global]
V1_API_KEY=
V1_API_PASSWD=

V2_API_USERNAME=
V2_API_PASSWD=

blueprint_ftp_url=ftp://user:password@ftp_fqdn
```
The CLI command is clc in Linux or MacOSX and clc-cli for Windows.
`clc-cli` --help will print out the help message,

```
usage: clc-cli.exe [-h] [--cols [COL [COL ...]]] [--config CONFIG] [--v1-api-key KEY] [--v1-api-passwd PASSWORD]                    [--v2-api-username USERNAME] [--v2-api-passwd PASSWORD] [--async] [--quiet] [--verbose] [--format {json,table,text,csv}]                    {accounts,users,servers,groups,billing,networks,queue,blueprints} ...

CLI tool for interacting with CenturyLink Cloud API.  
optional arguments:
  -h, --help                  show this help message and exit
  --cols [COL [COL ...]]      Include only specific columns in the output
  --config CONFIG, -c         CONFIG Ini config file
  --v1-api-key KEY            V1 API key
  --v1-api-passwd PASSWORD    <PASSWORD>
  --v2-api-username USERNAME  V2 API username
  --v2-api-passwd PASSWORD    <PASSWORD>
  --async                     Return immediately after queueing long-running calls
  --quiet, -q                 Supress status output (repeat up to 2 times)
  --verbose, -v               Increase verbosity
  --format {json,table,text,csv}, -f {json,table,text,csv}  Output result format (table is default)

Commands:
  {accounts,users,servers,groups,billing,networks,queue,blueprints}
    accounts            Account level activities (list, create, modify)
    users               User level activities (list, create, modify)
    servers             Server level activities (list, create, modify)
    groups              Group level activities (list, create, modify)
    billing             Billing activities
    networks            Network activities
    queue               Work queue
    blueprints          Blueprints
    ```
<commit_msg>Fixing formatting<commit_after>{{{
  "title": "CenturyLink Cloud Guide to CLI",
  "date": "02-13-2016",
  "author": "<NAME>",
  "attachments": [],
  "contentIsHTML": false
}}}
### Table of contents

* [Overview](#overview)
* [Prerequisites](#prerequisites)
* [Use Case Scenarios](#use-case-scenarios)
* [Installation of CenturyLink Cloud CLI](#installation-of-centurylink-cloud-cli)
* [READ commands](#read-commands)
* [Billing and Accounting](#billing-and-accounting)
* [Commands change the environment](#commands-change-the-environment)
* [Advanced usage](#advanced-usage)
* [Support](#support)

### Overview

There are two CLI interfaces available on CenturyLink Cloud, GO based
CLI for API v2 (explains here) and Python based CLI for API v1 and v2.

For accounts, users, groups, [API v1](//github.com/CenturyLinkCloud/clc-python-sdk/blob/master/README_CLI.md) provides the access to this information. For the rest of the data, [API v2](https://www.ctl.io/api-docs/v2/) can be used to access this information.

For detail usage of CLI v1 and download, please see its [GitHub
repository](//github.com/CenturyLinkCloud/clc-python-sdk/blob/master/README_CLI.md).
The windows CLI executable can be downloaded from
[here](//github.com/CenturyLinkCloud/clc-python-sdk/raw/master/src/dist/clc-cli.exe).

Comparison of the two CLI tools:

| CLI         |   Python            | Go                  |
| ---------   | ------------------- | -----------------   |
| API version | Mostly v1 (some v2) |         v2          |
| Resources     |  accounts           |   alert-policy      |
|             | billing             |  anti-affinity-policy |
|             | blueprints          |  autoscale-policy   |
|             | groups              | billing             |
|             | networks            | custom-fields       |
|             | queue               | data-center         |
|             | servers             | firewall-policy     |
|             | users               | group               |
|             |                     | load-balancer       |
|             |                     | load-balancer-pool  |
|             |                     | login               |
|             |                     | network             |
|             |                     | server              |
|             |                     | wait                |

The GO based CLI can be run on Mac OSX, Linux and Windows. For
download page, please see the [CenturyLink Cloud CLI GitHub release
page](//github.com/CenturyLinkCloud/clc-go-cli/releases).  
The Python based SDK is crossed platform, the CLI can be ran on any Python 2.7 environment.  There is a pre-complied Windows version of the CLI, it is available [here](https://github.com/CenturyLinkCloud/clc-python-sdk/raw/master/src/dist/clc-cli.exe).  A
The resources available on both tools will output similar results, at this time, certain functions are only available on API v1, hence the need of both tools to capture all the functionalities of the platform.

### Prerequisites
-   Access to the CenturyLink Cloud platform as an authorized user
-   Understanding of CenturyLink Cloud portal
-   Scripting knowledge will help on fully utilizing the CLI
-   Python 2.7 installed in the environment for Python based CLI
-   API user account [please see this KB for detail](https://www.ctl.io/knowledge-base/accounts-&-users/creating-users/)

### Use Case Scenarios
This tool enables system administrators to interface with CenturyLink Cloud without programming with the API or the using the Control Portal.  Automation can be achieved using scripting and other automation tools.

### Installation of CenturyLink Cloud CLI

***In order to make easy distintion between the two CLIs, clc-cli is the Python based tool and clc is the GO based tool.***

**Python Based CLI:**

Installation instruction is available [here](https://github.com/CenturyLinkCloud/clc-python-sdk).  If pip is installed, then the following command will installed the CenturyLink Cloud Python SDK and CLI:
```
pip install clc-sdk
```
For authentication, it can be several way, please see the [README page of the CLI](https://github.com/CenturyLinkCloud/clc-python-sdk/blob/master/README_CLI.md#authentication).  In order to use a system configuration file, a clc.ini (Windows) or clc_config (POSIX) needs to be created.  An example is shown below:
```
[global]
V1_API_KEY=
V1_API_PASSWD=

V2_API_USERNAME=
V2_API_PASSWD=

blueprint_ftp_url=ftp://user:password@ftp_fqdn
```
The CLI command is clc in Linux or MacOSX and clc-cli for Windows.
`clc-cli` --help will print out the help message,

```
usage: clc-cli.exe [-h] [--cols [COL [COL ...]]] [--config CONFIG] [--v1-api-key KEY] [--v1-api-passwd PASSWORD]                    [--v2-api-username USERNAME] [--v2-api-passwd PASSWORD] [--async] [--quiet] [--verbose] [--format {json,table,text,csv}]                    {accounts,users,servers,groups,billing,networks,queue,blueprints} ...

CLI tool for interacting with CenturyLink Cloud API.  
optional arguments:
  -h, --help                  show this help message and exit
  --cols [COL [COL ...]]      Include only specific columns in the output
  --config CONFIG, -c         CONFIG Ini config file
  --v1-api-key KEY            V1 API key
  --v1-api-passwd PASSWORD    V1 API password
  --v2-api-username USERNAME  V2 API username
  --v2-api-passwd PASSWORD    V2 API password
  --async                     Return immediately after queueing long-running calls
  --quiet, -q                 Supress status output (repeat up to 2 times)
  --verbose, -v               Increase verbosity
  --format {json,table,text,csv}, -f {json,table,text,csv}  Output result format (table is default)

Commands:
  {accounts,users,servers,groups,billing,networks,queue,blueprints}
    accounts            Account level activities (list, create, modify)
    users               User level activities (list, create, modify)
    servers             Server level activities (list, create, modify)
    groups              Group level activities (list, create, modify)
    billing             Billing activities
    networks            Network activities
    queue               Work queue
    blueprints          Blueprints

```


{'fraction_non_alphanumeric': 0.10581245985870263, 'fraction_numerical': 0.006262042389210019, 'mean_word_length': 2.3450590762620838, 'pattern_counts': {'":': 10, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 10, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7474460', 'n_tokens_mistral': 3588, 'n_tokens_neox': 3414, 'n_words': 1183}