akamai / cli-sandbox

Akamai CLI for Sandbox
https://github.com/akamai/cli
Apache License 2.0
13 stars 12 forks source link

Sandbox Recipe file does not accept Property Version #39

Closed akhiljay closed 3 years ago

akhiljay commented 5 years ago

Issue Type: Bug

When trying to create a sandbox with two properties with property version, the CLI automatically pulls the first version of the property and creates a sandbox config based on that first version.

Below is the recipe file I used

{
  "sandbox": {
    "clonable": true,
    "name":"wap-ion-ipa-finaltest",
    "properties": [
      {
        "property": "a.foo.com",
        "propertyVersion": 24
      },
      {
        "property": "sandbox-playground",
        "propertyVersion": 10
      }
    ]
  },
  "clientConfig" : {
    "sandboxServerInfo": {
      "secure": false,
      "port": 5050,
      "host": "127.0.0.1"
    },
    "originMappings": [
    {
      "from": "origin-sandbox.akamai.tools",
      "to": {
        "secure": true,
        "port": 443,
        "host": "www.akamai.com",
        "hostHeader":"www.akamai.com"
      }
    },
    {
      "from": "origin.foo.com",
      "to": {
        "secure": true,
        "port": 443,
        "host": "developer.akamai.com",
        "hostHeader":"developer.akamai.com"
      }
    }
    ]
  }
}

When I use the API I am able to create the sandbox with the right property version.

kporowski commented 4 years ago

Sandbox CLI recipe uses the same property format as defined for property option:

-p, --property <property_id | property_name : version>  Property to base the sandbox on.
        If an active version is not found, the most recent version is used.

So each of the following are allowed:

447903:4 // use property_id and version
447903 // use just property_id and latest version
www.example.com:4 // use hostname and version
www.example.com // use just hostname

Would that explanation help?

krzyk commented 3 years ago

@akhiljay Does the explanation in https://github.com/akamai/cli-sandbox/issues/39#issuecomment-630765958 help? If so please close this issue, thanks.

kporowski commented 3 years ago

Closing, as it is working as explained.