Skip to content

TaskParam missing Default and Sensitive fields #95

@dpierson-splunk

Description

@dpierson-splunk

Describe the Bug

I am trying to retrieve the Default and Sensitive fields of a TaskParam in the task metadata, but the fields aren't defined in the TaskParam type.

// TaskParam in the task metadata
type TaskParam struct {
Description string `json:"description,omitempty"`
Type string `json:"type,omitempty"`
}

The Puppet Orchestrator API returns these fields.
https://www.puppet.com/docs/pe/2023.7/orchestrator_api_tasks_endpoint#orchestrator_api_get_tasks_module_taskname

Expected Behavior

When retrieving tasks, the task's metadata for parameters should contain the Default and Sensitive fields (and their values) if populated.

type TaskParam struct {
 	Description string `json:"description,omitempty"`
 	Type        string `json:"type,omitempty"`
	Default   interface{} `json:"default,omitempty"`
	Sensitive bool        `json:"sensitive,omitempty"`
 }

Steps to Reproduce

Steps to reproduce the behavior:

  1. Call a Client's Task or TaskbyID method to retrieve a Task.
  2. The Task's TaskMetadata has a map of TaskParams, but they won't include Default or Sensitive fields even if the API call returns them.

Environment

  • Version [e.g. 1.27.0] v1.11.0
  • Platform [e.g. Ubuntu 18.04] macOS 14.4.1

Additional Context

I believe we just need to define the Default and Sensitive fields in the TaskParam type (as in the above example)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions