Users and instances now have different endpoint for listing tools. Moreover, users can now use a flag to see what tools are available upstream if sync is off: garm-cli controller tools list --upstream Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
232 lines
6 KiB
Go
232 lines
6 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package tools
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
"time"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/runtime"
|
|
cr "github.com/go-openapi/runtime/client"
|
|
"github.com/go-openapi/strfmt"
|
|
"github.com/go-openapi/swag"
|
|
)
|
|
|
|
// NewAdminGarmAgentListParams creates a new AdminGarmAgentListParams object,
|
|
// with the default timeout for this client.
|
|
//
|
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
|
//
|
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
|
func NewAdminGarmAgentListParams() *AdminGarmAgentListParams {
|
|
return &AdminGarmAgentListParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewAdminGarmAgentListParamsWithTimeout creates a new AdminGarmAgentListParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewAdminGarmAgentListParamsWithTimeout(timeout time.Duration) *AdminGarmAgentListParams {
|
|
return &AdminGarmAgentListParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewAdminGarmAgentListParamsWithContext creates a new AdminGarmAgentListParams object
|
|
// with the ability to set a context for a request.
|
|
func NewAdminGarmAgentListParamsWithContext(ctx context.Context) *AdminGarmAgentListParams {
|
|
return &AdminGarmAgentListParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewAdminGarmAgentListParamsWithHTTPClient creates a new AdminGarmAgentListParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewAdminGarmAgentListParamsWithHTTPClient(client *http.Client) *AdminGarmAgentListParams {
|
|
return &AdminGarmAgentListParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
AdminGarmAgentListParams contains all the parameters to send to the API endpoint
|
|
|
|
for the admin garm agent list operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type AdminGarmAgentListParams struct {
|
|
|
|
/* Page.
|
|
|
|
The page at which to list.
|
|
*/
|
|
Page *int64
|
|
|
|
/* PageSize.
|
|
|
|
Number of items per page.
|
|
*/
|
|
PageSize *int64
|
|
|
|
/* Upstream.
|
|
|
|
If true, list tools from the upstream cached release instead of the local object store.
|
|
*/
|
|
Upstream *bool
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the admin garm agent list params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *AdminGarmAgentListParams) WithDefaults() *AdminGarmAgentListParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the admin garm agent list params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *AdminGarmAgentListParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) WithTimeout(timeout time.Duration) *AdminGarmAgentListParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) WithContext(ctx context.Context) *AdminGarmAgentListParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) WithHTTPClient(client *http.Client) *AdminGarmAgentListParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithPage adds the page to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) WithPage(page *int64) *AdminGarmAgentListParams {
|
|
o.SetPage(page)
|
|
return o
|
|
}
|
|
|
|
// SetPage adds the page to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) SetPage(page *int64) {
|
|
o.Page = page
|
|
}
|
|
|
|
// WithPageSize adds the pageSize to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) WithPageSize(pageSize *int64) *AdminGarmAgentListParams {
|
|
o.SetPageSize(pageSize)
|
|
return o
|
|
}
|
|
|
|
// SetPageSize adds the pageSize to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) SetPageSize(pageSize *int64) {
|
|
o.PageSize = pageSize
|
|
}
|
|
|
|
// WithUpstream adds the upstream to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) WithUpstream(upstream *bool) *AdminGarmAgentListParams {
|
|
o.SetUpstream(upstream)
|
|
return o
|
|
}
|
|
|
|
// SetUpstream adds the upstream to the admin garm agent list params
|
|
func (o *AdminGarmAgentListParams) SetUpstream(upstream *bool) {
|
|
o.Upstream = upstream
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *AdminGarmAgentListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
if o.Page != nil {
|
|
|
|
// query param page
|
|
var qrPage int64
|
|
|
|
if o.Page != nil {
|
|
qrPage = *o.Page
|
|
}
|
|
qPage := swag.FormatInt64(qrPage)
|
|
if qPage != "" {
|
|
|
|
if err := r.SetQueryParam("page", qPage); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if o.PageSize != nil {
|
|
|
|
// query param pageSize
|
|
var qrPageSize int64
|
|
|
|
if o.PageSize != nil {
|
|
qrPageSize = *o.PageSize
|
|
}
|
|
qPageSize := swag.FormatInt64(qrPageSize)
|
|
if qPageSize != "" {
|
|
|
|
if err := r.SetQueryParam("pageSize", qPageSize); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if o.Upstream != nil {
|
|
|
|
// query param upstream
|
|
var qrUpstream bool
|
|
|
|
if o.Upstream != nil {
|
|
qrUpstream = *o.Upstream
|
|
}
|
|
qUpstream := swag.FormatBool(qrUpstream)
|
|
if qUpstream != "" {
|
|
|
|
if err := r.SetQueryParam("upstream", qUpstream); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|