New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter order doesn't work, position is ignored #433

Closed
pietervogelaar opened this Issue Nov 21, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@pietervogelaar

pietervogelaar commented Nov 21, 2017

The following AJAX request to my action /api/v1/actions/views/overview/my_vm.create_vm returns the following response to the st2web UI:

{
    "runner_type": "python-script",
    "name": "create_vm",
    "parameters": {
        "memory": {
            "default": 2048,
            "position": 5,
            "required": true,
            "type": "integer",
            "description": "Memory size (MB)"
        },
        "initiator": {
            "default": "{{ action_context.user }}",
            "required": true,
            "description": "The user who executed this action",
            "immutable": true
        },
        "env": {
            "type": "object",
            "description": "Environment variables which will be available to the script."
        },
        "vlan": {
            "default": "applications",
            "position": 1,
            "required": true,
            "description": "Possible values: applications, storage",
            "enum": [
                "",
                "applications",
                "storage",
            ]
        },
        "storage_type": {
            "default": "default",
            "position": 6,
            "required": true,
            "description": "Possible values are \"default\" or \"replicated\"",
            "enum": [
                "",
                "default",
                "replicated"
            ]
        },
        "timeout": {
            "default": 600,
            "type": "integer",
            "description": "Action timeout in seconds. Action will get killed if it doesn't finish in timeout seconds."
        },
        "data_center": {
            "default": "dc1",
            "position": 0,
            "required": true,
            "description": "Possible values are \"dc1\" or \"dc2\"",
            "enum": [
                "",
                "dc1",
                "dc2"
            ]
        },
        "ipaddress": {
            "position": 3,
            "required": true,
            "description": "IP address"
        },
        "cpu": {
            "default": 2,
            "position": 4,
            "required": true,
            "type": "integer",
            "description": "CPU amount"
        },
        "name": {
            "position": 2,
            "required": true,
            "description": "VM name"
        }
    },
    "tags": [],
    "enabled": true,
    "entry_point": "create_vm.py",
    "notify": {},
    "uid": "action:my_vm:create_vm",
    "pack": "my_vm",
    "ref": "my_vm.create_vm",
    "id": "8bca0870af970ac05872mEiR8",
    "description": "Creates a VM in VMWare vSphere. IMPORTANT: In most cases use deploy_vm workflow instead of this action directly."
}

However it is displayed in this order:

  • cpu
  • data_center
  • ipaddress
  • memory
  • name
  • storage_type
  • vlan
@LindsayHill

This comment has been minimized.

Show comment
Hide comment
@LindsayHill

LindsayHill Nov 28, 2017

Contributor

Which ST2 version are you running? There were some changes to positioning around the 2.3/2.4 versions. It should now follow this ordering:

  1. Ordered parameters first, in numerical order
  2. Required parameters with unspecified position, in alphabetical order
  3. Any remaining parameters, in alphabetical order.
Contributor

LindsayHill commented Nov 28, 2017

Which ST2 version are you running? There were some changes to positioning around the 2.3/2.4 versions. It should now follow this ordering:

  1. Ordered parameters first, in numerical order
  2. Required parameters with unspecified position, in alphabetical order
  3. Any remaining parameters, in alphabetical order.
@christopherjbaker

This comment has been minimized.

Show comment
Hide comment
@christopherjbaker

christopherjbaker Jan 11, 2018

Contributor

We have just (pre)released a complete rewrite (package 2.6dev). Can you confirm if this is still an issue?

Contributor

christopherjbaker commented Jan 11, 2018

We have just (pre)released a complete rewrite (package 2.6dev). Can you confirm if this is still an issue?

@LindsayHill

This comment has been minimized.

Show comment
Hide comment
@LindsayHill

LindsayHill May 26, 2018

Contributor

Closing due to no response. Please re-open if this is still an issue

Contributor

LindsayHill commented May 26, 2018

Closing due to no response. Please re-open if this is still an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment