Skip to content
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

Bug - Untyped enums (core.http.method) error out on the CLI in v2.4 #3737

Closed
nmaludy opened this issue Sep 12, 2017 · 0 comments
Closed

Bug - Untyped enums (core.http.method) error out on the CLI in v2.4 #3737

nmaludy opened this issue Sep 12, 2017 · 0 comments

Comments

@nmaludy
Copy link
Member

nmaludy commented Sep 12, 2017

Problem

[root@stackstorm ~]# st2 --version
st2 2.4.0
[root@stackstorm ~]# st2 run core.http url="https://docs.stackstorm.com/" method="GET"
ERROR: 'type'

This problem only exists on v2.4

[root@stackstormpuppet4 actions]# st2 --version
st2 2.3.2
[root@stackstormpuppet4 actions]# st2 run core.http url="https://docs.stackstorm.com" method="GET"
.
id: 59b7d90dd6552e551d05ba9f
status: succeeded
parameters: 
  method: GET
  url: https://docs.stackstorm.com
result: 
  body: "\n\n<!DOCTYPE html>\n<!--[if IE 8]><html class=
...

Workaround

By modifying the core.http action metadata YAML file and adding type: string to the method parameter, the CLI works as expected in v2.4.

---
description: Action that performs an http request.
enabled: true
entry_point: ''
name: http
parameters:
  auth:
    description: Auth string to be used. This can be like 'x-auth-token=XYZ'.
    type: string
  body:
    description: Body to send with the request
    type: string
  file_content:
    description: Magic attribute which is automatically populated when file_path is
      specified
    type: string
  file_content_type:
    description: Optional content type for the uploaded file
    type: string
  file_name:
    description: Magic attribute which is automatically populated when file_path is
      specified
    type: string
  file_path:
    description: Path to the file to upload
    type: string
  headers:
    description: 'HTTP headers to use with the request.'
    type: object
  method:
    description: HTTP method to use.
    type: string                                         # Add this line to get core.http working with a method='xxx' on the CLI
    enum:
    - HEAD
    - GET
    - POST
    - PUT
    - DELETE
  params:
    description: Query params to be used with the HTTP request.
    type: object
  timeout:
    default: 60
    description: Timeout for the HTTP request.
    type: number
runner_type: "http-request"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants