Deploy Hello World

Now that you've created the code bundle in the previous step, you can use HTTPie and httpie-edgegrid to access the ​Akamai​ APIs.

Add an EdgeWorker version

  1. Add a new version to the Hello World EdgeWorker ID.
    [block:code]
    {
    "codes": [
    {
    "code": "cat | http --timeout=30 --auth-type edgegrid -a : POST :/edgeworkers/v1/ids//versions Content-Type:application/gzip",
    "language": "shell"
    }
    ]
    }
    [/block]
  • Replace <edgeWorkerId> with the ID of your Hello World EdgeWorker.

  • Replace <edgeworker code bundle> with the filename and path to the Hello World code bundle.

  1. Issue this API request to verify that the EdgeWorker version was created:
    [block:code]
    {
    "codes": [
    {
    "code": "http --timeout=30 --auth-type edgegrid -a : POST :/edgeworkers/v1/ids//activations network= version=",
    "language": "shell"
    }
    ]
    }
    [/block]
  • Replace <edgeWorkerId> with the ID of your Hello World EdgeWorker.

  • Replace <network> with STAGING.

  • Replace <version> with the version number of your Hello World EdgeWorker ID.

Activate the EdgeWorker version

  1. Activate the EdgeWorker version on the ​Akamai​ network. Note the activationId. You'll need it to monitor the activation status.
    [block:code]
    {
    "codes": [
    {
    "code": "http --timeout=30 --auth-type edgegrid -a : POST :/edgeworkers/v1/ids//activations network= version=",
    "language": "shell"
    }
    ]
    }
    [/block]
  • Replace <edgeWorkerId> with the ID of your Hello World EdgeWorker.

  • Replace <network> with STAGING.

  • Replace <version> with the version number of your Hello World EdgeWorker ID.

  1. To monitor the activation of the EdgeWorker version, try issuing this API request.
    [block:code]
    {
    "codes": [
    {
    "code": "http --timeout=30 --auth-type edgegrid -a : GET :/edgeworkers/v1/ids//activations/ ",
    "language": "shell"
    }
    ]
    }
    [/block]
  • Replace <edgeWorkerId> with the ID of your Hello World EdgeWorker.

  • Replace <activationId> with the activation response.

    The activationId was provided in the previous step when the EdgeWorker ID was activated.

  1. Next, follow these instructions to test the Hello World code bundle.