Skip to content

Commit

Permalink
Merge pull request #109 from akamai/develop
Browse files Browse the repository at this point in the history
Release/1.6.0
  • Loading branch information
slukic0 authored Nov 9, 2022
2 parents c3756b0 + 784ffb0 commit c2e14fe
Show file tree
Hide file tree
Showing 34 changed files with 3,147 additions and 1,020 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/pullRequestBuildTest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test Pull Request
run-name: ${{ github.actor }} wants to merge ${{ github.head_ref }} into ${{ github.base_ref }}

on:
pull_request:
branches: [ master, develop ]

jobs:
test_pr:

runs-on: macos-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test:run
24 changes: 24 additions & 0 deletions .github/workflows/pullRequestLint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint Pull Request
run-name: ${{ github.actor }} wants to merge ${{ github.head_ref }} into ${{ github.base_ref }}

on:
pull_request:
branches: [ master, develop ]

jobs:
lint_pr:

runs-on: macos-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ npm-debug.log
DEVNOTES.txt
edgegrid-custom/
.env
tmp_tar
74 changes: 64 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Options:
| --section `<name>` | Use this section in `edgerc` file. (Default section is _[default]_)|
| --timeout `<timeout>` | You can specify a timeout value for a command in seconds to override the 2 minute default. For example, if you add "--timeout 10" to a command, it will timeout if the server takes more than 10 second to respond. |
| --json `[path]` | Write CLI output as JSON to optionally provided path. If not path provided, write JSON output to CLI home directory |
| --jsonout | Write CLI output as JSON to stdout. |
| -h, --help | Display usage information for EdgeWorkers CLI. |

Commands:
Expand All @@ -72,11 +73,14 @@ Commands:
| validate \| vv `<bundlePath>` | Validates a code bundle version without uploading the code bundle. |
| create-auth-token \| auth `[options] <hostName>` | Generates an authentication token that can be used to get detailed EdgeWorker debug response headers. |
| generate-secret \| secret `[options]` | Generates a secret key that can be used to generate auth token or in property variable. |
| clone \| clone `<edgeworker-identifier> <resourceTierId> [options]` | Clones an Edgeworker from the existing Edgeworker Id. |
| clone \| clone `<edgeworker-identifier> <resourceTierId> [options]` | Clones an EdgeWorker from the existing EdgeWorker Id. |
| list-contracts \| li-contracts `[options]` | List of contract ids that user has access to. |
| list-properties \| lp `<edgeworker-identifier> [options]` | List of properties associated with a given EdgeWorker Id. |
| list-limits \| li-limits | View the various limits EdgeWorkers imposes on the number of activations, EdgeWorkers IDs, and versions you can deploy. |
| list-restiers \| li-restiers `[options]` | List Resource Tiers that can be used to create or clone EdgeWorker Id. |
| show-restier \| show-restier `<edgeworker-identifier>` | Customers can get Resource Tier details for a specific EdgeWorker Id. |
| get reports | Get a list of all available EdgeWorkers reports. |
| get report `<reportId> <edgeworker-identifier> [options]` | Get an EdgeWorkers report for a specific EdgeWorker ID. |

### List Permission Groups with EdgeWorkers Access
Customer Developer can find their EdgeWorkers access level per Luna Access Control Group.
Expand Down Expand Up @@ -105,7 +109,7 @@ Usage: `akamai edgeworkers list-ids [options] [edgeworker-identifier]`
| - | - |
| -h, --help | output usage information |
| --groupId `<groupId>` | Filter EdgeWorker Id list by Permission Group |
| --resourceTierId `<resourceTierId>` | Filter Edgeworker Id by Resource Tier |
| --resourceTierId `<resourceTierId>` | Filter EdgeWorker Id by Resource Tier |

| Argument | Existence | Description |
| - | - | - |
Expand All @@ -118,7 +122,7 @@ Usage: `akamai edgeworkers register [options] <group-identifier> <edgeworker-nam

| Option | Description |
| - | - |
| --resourceTierId | New Resource tier id to which the Edgeworker will be associated. |
| --resourceTierId | New Resource tier id to which the EdgeWorker will be associated. |
| -h, --help | output usage information |

| Argument | Existence | Description |
Expand All @@ -140,7 +144,7 @@ Usage: `akamai edgeworkers update-id [options] <edgeworker-identifier> <group-id

| Option | Description |
| - | - |
| --resourceTierId | New Resource tier id to which the Edgeworker will be associated |
| --resourceTierId | New Resource tier id to which the EdgeWorker will be associated |
| -h, --help | output usage information |

| Argument | Existence | Description |
Expand Down Expand Up @@ -383,20 +387,20 @@ Generates a random secret key that can be used to create edgeworkers authenticat

Usage: `akamai edgeworkers generate-secret`

### Clone an Edgeworker Id
Allows customer to clone an Edgeworker from an existing Edgeworker Id.
### Clone an EdgeWorker Id
Allows customer to clone an EdgeWorker from an existing EdgeWorker Id.

Usage: `akamai edgeworkers clone <edgeworker-identifier> <resourceTierId> [options]`

| Option | Description |
| - | - |
| -h, --help | output usage information |
| --ewName | Name of the Edgeworker |
| --ewName | Name of the EdgeWorker |
| --groupId | Group identifier |

| Argument | Existence | Description |
| - | - | - |
| resourceTierId | required | Resource tier id to which the Edgeworker will be cloned.
| resourceTierId | required | Resource tier id to which the EdgeWorker will be cloned.

#### Key Details
1. This endpoint allows user to select a different Resource Tier ID for a specific EdgeWorker id by cloning it. Cloning to the same resource tier will fail.
Expand All @@ -422,11 +426,21 @@ Usage: `akamai edgeworkers list-properties <edgeworker-identifier> [options]`

| Argument | Existence | Description |
| - | - | - |
| edgeworker-identifier | required | Edgeworker identifier.
| edgeworker-identifier | required | EdgeWorker identifier.

#### Key Details
1. Note that the returned boolean limitedAccessToProperties is true if the user doesn't have access to the top level group under the account, or if they don't have the admin role for this group.

### List Limits
List the various limits EdgeWorkers imposes on the number of activations, EdgeWorkers IDs, and versions you can deploy.

Usage: `akamai edgeworkers list-limits [options]`

| Option | Description |
| - | - |
| -h, --help | output usage information |


### List Resource Tiers for a specific Contract ID
Allows customers to list Resource Tiers that can be used to create or clone EdgeWorker IDs.

Expand All @@ -452,7 +466,41 @@ Usage: `akamai show-restier <edgeworkerId>`

| Argument | Existence | Description |
| - | - | - |
| edgeworkerId | required | Edgeworker identifier.
| edgeworkerId | required | EdgeWorker identifier.

### Get Available EdgeWorkers Report Types
Allows customers to list the available report types that can be generated for an EdgeWorker ID.

Usage: `akamai get reports`

| Option | Description |
| - | - |
| -h, --help | output usage information |

#### Key Details
1. The user will be given a table with reportIds and a description of each report. Use a given reportId with the `get report` command to get a report for a given EdgeWorker.

### Get EdgeWorker Report
Allows customers to get a report for a given EdgeWorker ID.

Usage: `akamai get report <reportId> <edgeworker-identifier>`

| Option | Existence| Description |
| - | - | - |
| -h, --help | optional | output usage information |
| -s, --startDate `<startDate>` | required | ISO 8601 timestamp indicating the start time of the EdgeWorkers report. |
| -e, --endDate `<startDate>` | optional | ISO 8601 timestamp indicating the end time of the EdgeWorkers report. If not specified, the end time defaults to the current time. |
| --status `<status>` | optional | Comma-separated string to filter by EdgeWorkers status. Values: `success`, `genericError`, `unknownEdgeWorkerId`, `unimplementedEventHandler`, `runtimeError`, `executionError`, `timeoutError`, `resourceLimitHit`, `cpuTimeoutError`, `wallTimeoutError`, `initCpuTimeoutError`, `initWallTimeoutError`. |
| --ev, --eventHandlers `<eventHandlers>` | optional | Comma-separated string to filter EdgeWorkers by the event that triggers them. Values: `onClientRequest`, `onOriginRequest`, `onOriginResponse`, `onClientResponse`, `responseProvider`. |

| Argument | Existence | Description |
| - | - | - |
| reportId | required | Report Type. |
| edgeworker-identifier | required | EdgeWorker identifier. |

#### Key Details
1. For a list of available report IDs, use the `get reports` command.
2. The `startDate` option is a required option.

## Resources
For more information on EdgeWorkers, refer to the following resources:
Expand All @@ -463,6 +511,12 @@ For more information on EdgeWorkers, refer to the following resources:
## Reporting Issues
You are all set, happy coding! If you experience any issues with the EdgeWorkers CLI, raise them as a [github issue](https://github.com/akamai/cli-edgeworkers/issues). Feel free to create a pull request with the fix or suggestion.

## Contributing
We welcome contributions from Akamai staff, customers, or others. Before opening up a PR please double check the following:
1. Please add some test cases to accompany your PR. This verifies the functionality added or modified in the PR and proves to others that your code works :)
2. Please make sure that your code passes all pre-commit checks. Your code should build successfully, pass all unit tests, and have no linting issues.
3. All PR's should be targeting develop, not master. Merges to master will immediately release to all customers.

<!--esi
<esi:eval src="/internal/footer.html?http" dca="esi" />
-->
23 changes: 16 additions & 7 deletions docs/edgekv_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,22 @@ Usage:

1. When installing the Akamai CLI using the "akamai install edgeworkers" command you may run into a *"Package directory already exists"* error. This is likely because you already have the EdgeWorkers CLI package installed. In this case, please try updating the EdgeWorkers CLI package using “akamai update edgeworkers”.

If you continue to encounter this error when trying to update the Akamai CLI using the “akamai update edgeworkers” command, uninstall the Akamai CLI using the “akamai uninstall edgeworkers” command. This will remove the existing installation, allowing you to reinstall using the “akamai install edgeworkers” command.
If you continue to encounter this error when trying to update the Akamai CLI using the “akamai update edgeworkers” command, uninstall the Akamai CLI using the “akamai uninstall edgeworkers” command. This will remove the existing installation, allowing you to reinstall using the “akamai install edgeworkers” command.

2. Docker installation error
When installing Akamai CLI using docker, you may run into "Error: Cannot find module. '.bin/src/edgekv/ekv-cli-main.js".
When installing Akamai CLI using docker, you may run into "Error: Cannot find module. '.bin/src/edgekv/ekv-cli-main.js".

Build-time workaround - use this when building the Docker image
RUN `akamai install edgeworkers && cd $AKAMAI_CLI_HOME/.akamai-cli/src/cli-edgeworkers/ && npm run build`
Build-time workaround - use this when building the Docker image
RUN `akamai install edgeworkers && cd $AKAMAI_CLI_HOME/.akamai-cli/src/cli-edgeworkers/ && npm run build`

Runtime workaround - use this if Docker is already running
`cd ~/.akamai-cli/src/cli-edgeworkers/ && npm install --unsafe-perm`
Runtime workaround - use this if Docker is already running
`cd ~/.akamai-cli/src/cli-edgeworkers/ && npm install --unsafe-perm`

3. The EdgeKV CLI --overwrite option for the token create and download commands does not work when you change the token name associated with a namespace.

As a workaround, you can manually delete the token in question from the edgekv_tokens.js file before using the --save_path option. You can then use the token create and download CLI commands with the --save_path option to update the edgekv_tokens.js file.

For a broader list of all known EdgeKV issues please refer to the Akamai TechDocs [here](https://techdocs.akamai.com/edgekv/docs/known-issues]).

## Overview of Commands

Expand Down Expand Up @@ -170,6 +174,7 @@ Usage: `akamai edgekv create ns <environment> <nameSpace>`
2. The namespace identifier can be between 1 and 32 characters in length.
3. You cannot use the word "default" as the namespace identifier. The “default” namespace is already created during initialization.
4. Specifying "0" retention means indefinite retention.
5. A non-zero retention cannot be less than 1 day or more than 3650 days.

### List NameSpace

Expand All @@ -181,6 +186,9 @@ Usage: `akamai edgekv list ns <environment>`
| - | - |
| -h, --help | Display information on how to use this EdgeKV command. |
| -d, --details | Displays details of the namespace. |
| --order-by | Choose column to order by when displaying detailed namespace list. |
| --asc, --ascending | Sort using acscending order (default). |
| --desc, --descending | Sort using descending order. |

| Argument | Existence | Description |
| - | - | - |
Expand Down Expand Up @@ -216,6 +224,7 @@ Usage: `akamai edgekv modify ns <environment> <nameSpace>`
1. The namespace identifier can only include alphanumeric (0-9, a-z, A-Z), underscore (_), and (-) dash characters.
2. The namespace identifier can be between 1 and 32 characters in length.
3. You cannot modify the retention period for the "default" namespace.
4. A non-zero retention cannot be less than 1 day or more than 3650 days.

### Create or Update item

Expand Down Expand Up @@ -338,7 +347,7 @@ Example:
| --staging | Required | Acceptable value: 'allow', 'deny'. <br />Specifies whether the token will be allowed or denied in the staging environment. |
| -- production | Required | Acceptable value: 'allow', 'deny'. <br />Specifies whether the token will be allowed or denied in the production environment. |
| -- ewids | Required | Acceptable value: <br /> - 'all', <br /> - A comma separated list of up to a maximum of 8 EdgeWorker IDs. This restricts token usage to the specified EdgeWorker IDs. |
| --namespace | Required | Value: A comma separated list of up to a maximum of 20 namespace identifier and permission combinations. This list specifies where the token can be used. The permissions format is any combination of the following letters: <br /> - 'r' to authorize the token for read operations <br /> - 'w' to authorize the token for write operations <br /> - 'd' to authorize the token for delete operations. |
| --namespace | Required | Value: A comma separated list of up to a maximum of 20 namespace identifier and permission combinations. This list specifies where the token can be used. The permissions format is any combination of the following letters: <br /> - 'r' to authorize the token for read operations <br /> - 'w' to authorize the token for write operations <br /> - 'd' to authorize the token for delete operations. <br /> Example: "myNamespace1+rwd,myNamespace2+rw" |
| --expiry | Required | Expiration date of the token. Format of the expiry date is ISO 8601 format: yyyy-mm-dd. |
| -h, --help | Optional | Display information on how to use this EdgeKV command. |

Expand Down
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
*/

module.exports = {
EdgeKV: require("./src/edgekv/ekv-cli-main"),
EdgeWorkers: require("./src/edgeworkers/ew-cli-main")
EdgeKV: require('./src/edgekv/ekv-cli-main'),
EdgeWorkers: require('./src/edgeworkers/ew-cli-main')
};
Loading

0 comments on commit c2e14fe

Please sign in to comment.