Skip to content

Commit

Permalink
Rename ukfast to ans (#141)
Browse files Browse the repository at this point in the history
* rename ukfast to ans

* bump version
  • Loading branch information
0x4c6565 authored Jun 23, 2022
1 parent c9e0a4e commit b2ebbd1
Show file tree
Hide file tree
Showing 182 changed files with 521 additions and 525 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/debug
.vscode/
*.test
/ukfast.exe
/ukfast
/ans.exe
/ans
cover.out
dist/
__debug_bin
Expand Down
6 changes: 1 addition & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
project_name: ukfast
before:
hooks:
- go mod download
project_name: ans
builds:
- env:
- CGO_ENABLED=0
- GO111MODULE=on
ldflags:
- -s -X main.VERSION={{.Version}} -X main.BUILDDATE={{.Date}}
goos:
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM golang:1.16.4-alpine3.13 AS builder
FROM golang:1.18-alpine3.16 AS builder
RUN apk --no-cache add git
COPY . /build/
WORKDIR /build
ENV CGO_ENABLED 0
RUN go build -o ukfast -ldflags "-s -X 'main.VERSION=$(git describe --tags)' -X 'main.BUILDDATE=$(date +'%Y-%m-%dT%H:%M:%S')'"
RUN go build -o ans -ldflags "-s -X 'main.VERSION=$(git describe --tags)' -X 'main.BUILDDATE=$(date +'%Y-%m-%dT%H:%M:%S')'"

FROM alpine:3.13
FROM alpine:3.16
RUN apk --no-cache add ca-certificates bash bash-completion
COPY --from=builder /build/ukfast /bin/ukfast
COPY --from=builder /build/ans /bin/ans
RUN echo "source /usr/share/bash-completion/bash_completion" >> ~/.bashrc
RUN echo "source <(ukfast completion bash)" >> ~/.bashrc
ENTRYPOINT ["/bin/ukfast"]
RUN echo "source <(ans completion bash)" >> ~/.bashrc
ENTRYPOINT ["/bin/ans"]
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.PHONY: build build_windows build_mac test

build:
go build -o ukfast -ldflags "-s -X 'main.VERSION=$$(git describe --tags)' -X 'main.BUILDDATE=$$(date +'%Y-%m-%dT%H:%M:%S')'"
go build -o ans -ldflags "-s -X 'main.VERSION=$$(git describe --tags)' -X 'main.BUILDDATE=$$(date +'%Y-%m-%dT%H:%M:%S')'"

clean:
go clean --modcache
rm ukfast
rm ans

install:
sudo cp ukfast /usr/local/bin/
sudo cp ans /usr/local/bin/

build_windows:
GOOS=windows go build -o ukfast.exe -ldflags "-s -X 'main.VERSION=$$(git describe --tags)' -X 'main.BUILDDATE=$$(date +'%Y-%m-%dT%H:%M:%S')'"
GOOS=windows go build -o ans.exe -ldflags "-s -X 'main.VERSION=$$(git describe --tags)' -X 'main.BUILDDATE=$$(date +'%Y-%m-%dT%H:%M:%S')'"

build_mac:
GOOS=darwin go build -o ukfast -ldflags "-s -X 'main.VERSION=$$(git describe --tags)' -X 'main.BUILDDATE=$$(date +'%Y-%m-%dT%H:%M:%S')'"
GOOS=darwin go build -o ans -ldflags "-s -X 'main.VERSION=$$(git describe --tags)' -X 'main.BUILDDATE=$$(date +'%Y-%m-%dT%H:%M:%S')'"

test:
go test -v -cover ./...
Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# UKFast CLI
# ANS CLI

[![Build Status](https://travis-ci.org/ukfast/cli.svg?branch=master)](https://travis-ci.org/ukfast/cli)
[![Build Status](https://travis-ci.org/ans/cli.svg?branch=master)](https://travis-ci.org/ans/cli)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

This is the official UKFast command-line client, allowing for querying and controlling
supported UKFast services.
This is the official ANS command-line client, allowing for querying and controlling
supported ANS services.

The client utilises UKFast APIs to provide access to most service features. You should refer to the
The client utilises ANS APIs to provide access to most service features. You should refer to the
[Getting Started](https://developers.ukfast.io/getting-started) section of the API documentation before
proceeding below

Expand Down Expand Up @@ -45,7 +45,7 @@ PowerShell:
And away we go!

```
> ukfast safedns zone record show example.co.uk 3337874
> ans safedns zone record show example.co.uk 3337874
+---------+--------------------+------+---------+---------------------------+----------+-----+
| ID | NAME | TYPE | CONTENT | UPDATED AT | PRIORITY | TTL |
+---------+--------------------+------+---------+---------------------------+----------+-----+
Expand All @@ -61,7 +61,7 @@ Both of these methods are explained below.
### Configuration File

The configuration file is read from
`$HOME/.ukfast{.extension}` by default (extension being one of the `viper` supported formats such as `yml`, `yaml`, `json`, `toml` etc.). This path can be overridden with the `--config` flag.
`$HOME/.ans{.extension}` by default (extension being one of the `viper` supported formats such as `yml`, `yaml`, `json`, `toml` etc.). This path can be overridden with the `--config` flag.

Values defined in the configuration file take precedence over environment variables.

Expand Down Expand Up @@ -95,9 +95,9 @@ The configuration file can be manipulated using the `config` subcommand, for exa


```
> ukfast config context update --current --api-key test1
> ukfast config context update someothercontext --api-key test1
> ukfast config context switch someothercontext
> ans config context update --current --api-key test1
> ans config context update someothercontext --api-key test1
> ans config context switch someothercontext
```

### Environment variables
Expand All @@ -116,13 +116,13 @@ The default output format for the CLI is `Table`, which will be used when the va
is `table` or unspecified:

```
> ukfast safedns zone record list example.co.uk
> ans safedns zone record list example.co.uk
+---------+--------------------+------+-----------------------------------------------------------------------+---------------------------+----------+-------+
| ID | NAME | TYPE | CONTENT | UPDATED AT | PRIORITY | TTL |
+---------+--------------------+------+-----------------------------------------------------------------------+---------------------------+----------+-------+
| 3337865 | ns0.ukfast.net | NS | 185.226.220.128 | 2019-03-19T16:31:48+00:00 | 0 | 0 |
| 3337868 | ns1.ukfast.net | NS | 185.226.221.128 | 2019-03-19T16:31:48+00:00 | 0 | 0 |
| 3337871 | example.co.uk | SOA | ns0.ukfast.net support.ukfast.co.uk 2019031901 7200 3600 604800 86400 | 2019-03-19T16:31:48+00:00 | 0 | 86400 |
| 3337871 | example.co.uk | SOA | ns0.ukfast.net support.ans.co.uk 2019031901 7200 3600 604800 86400 | 2019-03-19T16:31:48+00:00 | 0 | 86400 |
| 3337874 | test.example.co.uk | A | 1.2.3.4 | 2019-03-19T16:33:55+00:00 | 0 | 0 |
+---------+--------------------+------+-----------------------------------------------------------------------+---------------------------+----------+-------+
```
Expand All @@ -134,7 +134,7 @@ The [Property Modifier](#property) is available for this format
Results can be output as a list using the `list` format:

```
> ukfast safedns zone record show example.co.uk 3337874 --output list
> ans safedns zone record show example.co.uk 3337874 --output list
id : 3337874
name : test.example.co.uk
type : A
Expand All @@ -151,7 +151,7 @@ The [Property Modifier](#property) is available for this format
Results can be output in JSON using the `json` format:

```
> ukfast safedns zone record show example.co.uk 3337874 --output json
> ans safedns zone record show example.co.uk 3337874 --output json
[{"id":3337874,"template_id":0,"name":"test.example.co.uk","type":"A","content":"1.2.3.4","updated_at":"2019-03-19T16:33:55+00:00","ttl":0,"priority":0}]
```

Expand All @@ -160,7 +160,7 @@ Results can be output in JSON using the `json` format:
Results can be output in YAML using the `yaml` format:

```
> ukfast safedns zone record show example.co.uk 3337874 --output yaml
> ans safedns zone record show example.co.uk 3337874 --output yaml
- id: 3337874
templateid: 0
name: test.example.co.uk
Expand All @@ -176,12 +176,12 @@ Results can be output in YAML using the `yaml` format:
Results can be output with a value or set of values using the `value` format:

```
> ukfast safedns zone record show example.co.uk 3337874 --output value
> ans safedns zone record show example.co.uk 3337874 --output value
3337874 test.example.co.uk A 1.2.3.4 2019-03-19T16:33:55+00:00 0 0
```

```
> ukfast safedns zone record show example.co.uk 3337874 --output value --property id
> ans safedns zone record show example.co.uk 3337874 --output value --property id
3337874
```
Expand All @@ -192,7 +192,7 @@ The [Property Modifier](#property) is available for this format
Results can be output as CSV using the `csv` format:
```
> ukfast safedns zone record show example.co.uk 3337874 --output csv
> ans safedns zone record show example.co.uk 3337874 --output csv
id,name,type,content,updated_at,priority,ttl
3337874,test.example.co.uk,A,1.2.3.4,2019-03-19T16:33:55+00:00,0,0
```
Expand All @@ -205,7 +205,7 @@ Results can be output using a supplied Golang template string using the `templat
in conjunction with output arguments, e.g.
```
> ukfast safedns zone record list example.co.uk --output template="Record name: {{ .Name }}, Type: {{ .Type }}"
> ans safedns zone record list example.co.uk --output template="Record name: {{ .Name }}, Type: {{ .Type }}"
Record name: ns0.ukfast.net, Type: NS
Record name: ns1.ukfast.net, Type: NS
Record name: example.co.uk, Type: SOA
Expand All @@ -218,7 +218,7 @@ Results can be output via JSON Path using the `jsonpath` format
in conjunction with output arguments, e.g.
```
> ukfast safedns zone record list example.co.uk --output jsonpath="{[*].name}"
> ans safedns zone record list example.co.uk --output jsonpath="{[*].name}"
example.co.uk example.co.uk example.co.uk test.example.co.uk
```
Expand All @@ -232,14 +232,14 @@ Some output formats support the `--property` output modifier.
Required properties can be specified with the `--property` format modifer flag:
```
> ukfast safedns zone record show example.co.uk 3337874 --output value --property name
> ans safedns zone record show example.co.uk 3337874 --output value --property name
test.example.co.uk
```
The property modifier accepts a comma-delimited list of property names, and is also repeatable:
```
> ukfast safedns zone record show example.co.uk 3337874 --output value --property id,name --property content
> ans safedns zone record show example.co.uk 3337874 --output value --property id,name --property content
3337874 test.example.co.uk 1.2.3.4
```
Expand Down Expand Up @@ -276,10 +276,10 @@ When using `list` commands, sorting is available via the `--sort` flag.
The CLI has self-update functionality, which can be invoked via the command `update`:
```
> ukfast update
> ans update
```
This command in-place updates the CLI, with the old binary moved to `ukfast.old` (`ukfast.old.exe` on Windows), should roll-back be required.
This command in-place updates the CLI, with the old binary moved to `ans.old` (`ans.old.exe` on Windows), should roll-back be required.
## Shell autocompletions
Expand All @@ -289,7 +289,7 @@ The CLI supports generating shell completions for the following shells:
* Zsh
* PowerShell
The commands at `ukfast completion <shell: bash|zsh|powershell>` provide help for installation on different platforms
The commands at `ans completion <shell: bash|zsh|powershell>` provide help for installation on different platforms
## eCloud VPC resources
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ switch ($OS)
}
}

$output = "ukfast"
$output = "ans"
if ($env:GOOS -eq "windows" -or ([string]::IsNullOrEmpty($env:GOOS) -and $Env:OS -eq "Windows_NT"))
{
$output = $output+".exe"
Expand Down
4 changes: 2 additions & 2 deletions cmd/account/account_contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func accountContactListCmd(f factory.ClientFactory) *cobra.Command {
Use: "list",
Short: "Lists contacts",
Long: "This command lists contacts",
Example: "ukfast account contact list",
Example: "ans account contact list",
RunE: func(cmd *cobra.Command, args []string) error {
c, err := f.NewClient()
if err != nil {
Expand Down Expand Up @@ -61,7 +61,7 @@ func accountContactShowCmd(f factory.ClientFactory) *cobra.Command {
Use: "show <contact: id>...",
Short: "Shows a contact",
Long: "This command shows one or more contacts",
Example: "ukfast account contact show 123",
Example: "ans account contact show 123",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("Missing contact")
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/account_credit.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func accountCreditListCmd(f factory.ClientFactory) *cobra.Command {
Use: "list",
Short: "Lists credits",
Long: "This command lists credits",
Example: "ukfast account credit list",
Example: "ans account credit list",
RunE: func(cmd *cobra.Command, args []string) error {
c, err := f.NewClient()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/account_details.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func accountDetailsShowCmd(f factory.ClientFactory) *cobra.Command {
Use: "show",
Short: "Shows account details",
Long: "This command shows account details",
Example: "ukfast account detail show",
Example: "ans account detail show",
RunE: func(cmd *cobra.Command, args []string) error {
c, err := f.NewClient()
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions cmd/billing/billing_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func billingCardListCmd(f factory.ClientFactory) *cobra.Command {
Use: "list",
Short: "Lists cards",
Long: "This command lists cards",
Example: "ukfast billing card list",
Example: "ans billing card list",
RunE: func(cmd *cobra.Command, args []string) error {
c, err := f.NewClient()
if err != nil {
Expand Down Expand Up @@ -65,7 +65,7 @@ func billingCardShowCmd(f factory.ClientFactory) *cobra.Command {
Use: "show <card: id>...",
Short: "Shows a card",
Long: "This command shows one or more cards",
Example: "ukfast billing card show 123",
Example: "ans billing card show 123",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("Missing card")
Expand Down Expand Up @@ -110,7 +110,7 @@ func billingCardCreateCmd(f factory.ClientFactory) *cobra.Command {
Use: "create",
Short: "Creates a card",
Long: "This command creates a card",
Example: "ukfast billing card create",
Example: "ans billing card create",
RunE: func(cmd *cobra.Command, args []string) error {
c, err := f.NewClient()
if err != nil {
Expand Down Expand Up @@ -174,7 +174,7 @@ func billingCardUpdateCmd(f factory.ClientFactory) *cobra.Command {
Use: "update <virtualmachine: id>...",
Short: "Updates a card",
Long: "This command updates one or more cards",
Example: "ukfast billing card update 123 --name \"test card 1\"",
Example: "ans billing card update 123 --name \"test card 1\"",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("Missing card")
Expand Down Expand Up @@ -257,7 +257,7 @@ func billingCardDeleteCmd(f factory.ClientFactory) *cobra.Command {
Use: "delete <card: id>...",
Short: "Removes a card",
Long: "This command removes one or more cards",
Example: "ukfast billing card delete 123",
Example: "ans billing card delete 123",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("Missing card")
Expand Down
2 changes: 1 addition & 1 deletion cmd/billing/billing_cloudcost.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func billingCloudCostListCmd(f factory.ClientFactory) *cobra.Command {
Use: "list",
Short: "Lists cloud costs",
Long: "This command lists cloud costs",
Example: "ukfast billing cloudcost list",
Example: "ans billing cloudcost list",
RunE: func(cmd *cobra.Command, args []string) error {
c, err := f.NewClient()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/billing/billing_directdebit.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func billingDirectDebitShowCmd(f factory.ClientFactory) *cobra.Command {
Use: "show",
Short: "Shows direct debit details",
Long: "This command shows direct debit details",
Example: "ukfast billing directdebit show",
Example: "ans billing directdebit show",
RunE: func(cmd *cobra.Command, args []string) error {
c, err := f.NewClient()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/billing/billing_invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func billingInvoiceListCmd(f factory.ClientFactory) *cobra.Command {
Use: "list",
Short: "Lists invoices",
Long: "This command lists invoices",
Example: "ukfast billing invoice list",
Example: "ans billing invoice list",
RunE: func(cmd *cobra.Command, args []string) error {
c, err := f.NewClient()
if err != nil {
Expand Down Expand Up @@ -61,7 +61,7 @@ func billingInvoiceShowCmd(f factory.ClientFactory) *cobra.Command {
Use: "show <invoice: id>...",
Short: "Shows a invoice",
Long: "This command shows one or more invoices",
Example: "ukfast billing invoice show 123",
Example: "ans billing invoice show 123",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("Missing invoice")
Expand Down
6 changes: 3 additions & 3 deletions cmd/billing/billing_invoicequery.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func billingInvoiceQueryListCmd(f factory.ClientFactory) *cobra.Command {
Use: "list",
Short: "Lists invoice queries",
Long: "This command lists invoice queries",
Example: "ukfast billing invoicequery list",
Example: "ans billing invoicequery list",
RunE: func(cmd *cobra.Command, args []string) error {
c, err := f.NewClient()
if err != nil {
Expand Down Expand Up @@ -62,7 +62,7 @@ func billingInvoiceQueryShowCmd(f factory.ClientFactory) *cobra.Command {
Use: "show <invoicequery: id>...",
Short: "Shows an invoice query",
Long: "This command shows one or more invoice queries",
Example: "ukfast billing invoicequery show 123",
Example: "ans billing invoicequery show 123",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("Missing invoice query")
Expand Down Expand Up @@ -107,7 +107,7 @@ func billingInvoiceQueryCreateCmd(f factory.ClientFactory) *cobra.Command {
Use: "create",
Short: "Creates a invoice query",
Long: "This command creates a new invoice query",
Example: "ukfast billing invoice query create",
Example: "ans billing invoice query create",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("Missing invoice")
Expand Down
Loading

0 comments on commit b2ebbd1

Please sign in to comment.