github.com/kata-containers/runtime@v0.0.0-20210505125100-04f29832a923/virtcontainers/pkg/firecracker/client/operations/operations_client.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package operations
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"github.com/go-openapi/runtime"
    10  
    11  	strfmt "github.com/go-openapi/strfmt"
    12  )
    13  
    14  // New creates a new operations API client.
    15  func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
    16  	return &Client{transport: transport, formats: formats}
    17  }
    18  
    19  /*
    20  Client for operations API
    21  */
    22  type Client struct {
    23  	transport runtime.ClientTransport
    24  	formats   strfmt.Registry
    25  }
    26  
    27  /*
    28  GetMmds gets the m m d s data store
    29  */
    30  func (a *Client) GetMmds(params *GetMmdsParams) (*GetMmdsOK, error) {
    31  	// TODO: Validate the params before sending
    32  	if params == nil {
    33  		params = NewGetMmdsParams()
    34  	}
    35  
    36  	result, err := a.transport.Submit(&runtime.ClientOperation{
    37  		ID:                 "GetMmds",
    38  		Method:             "GET",
    39  		PathPattern:        "/mmds",
    40  		ProducesMediaTypes: []string{"application/json"},
    41  		ConsumesMediaTypes: []string{"application/json"},
    42  		Schemes:            []string{"http"},
    43  		Params:             params,
    44  		Reader:             &GetMmdsReader{formats: a.formats},
    45  		Context:            params.Context,
    46  		Client:             params.HTTPClient,
    47  	})
    48  	if err != nil {
    49  		return nil, err
    50  	}
    51  	return result.(*GetMmdsOK), nil
    52  
    53  }
    54  
    55  /*
    56  PatchMmds updates the m m d s data store
    57  */
    58  func (a *Client) PatchMmds(params *PatchMmdsParams) (*PatchMmdsNoContent, error) {
    59  	// TODO: Validate the params before sending
    60  	if params == nil {
    61  		params = NewPatchMmdsParams()
    62  	}
    63  
    64  	result, err := a.transport.Submit(&runtime.ClientOperation{
    65  		ID:                 "PatchMmds",
    66  		Method:             "PATCH",
    67  		PathPattern:        "/mmds",
    68  		ProducesMediaTypes: []string{"application/json"},
    69  		ConsumesMediaTypes: []string{"application/json"},
    70  		Schemes:            []string{"http"},
    71  		Params:             params,
    72  		Reader:             &PatchMmdsReader{formats: a.formats},
    73  		Context:            params.Context,
    74  		Client:             params.HTTPClient,
    75  	})
    76  	if err != nil {
    77  		return nil, err
    78  	}
    79  	return result.(*PatchMmdsNoContent), nil
    80  
    81  }
    82  
    83  /*
    84  PutMmds creates a m m d s microvm metadata service data store
    85  */
    86  func (a *Client) PutMmds(params *PutMmdsParams) (*PutMmdsNoContent, error) {
    87  	// TODO: Validate the params before sending
    88  	if params == nil {
    89  		params = NewPutMmdsParams()
    90  	}
    91  
    92  	result, err := a.transport.Submit(&runtime.ClientOperation{
    93  		ID:                 "PutMmds",
    94  		Method:             "PUT",
    95  		PathPattern:        "/mmds",
    96  		ProducesMediaTypes: []string{"application/json"},
    97  		ConsumesMediaTypes: []string{"application/json"},
    98  		Schemes:            []string{"http"},
    99  		Params:             params,
   100  		Reader:             &PutMmdsReader{formats: a.formats},
   101  		Context:            params.Context,
   102  		Client:             params.HTTPClient,
   103  	})
   104  	if err != nil {
   105  		return nil, err
   106  	}
   107  	return result.(*PutMmdsNoContent), nil
   108  
   109  }
   110  
   111  /*
   112  CreateSyncAction creates a synchronous action
   113  */
   114  func (a *Client) CreateSyncAction(params *CreateSyncActionParams) (*CreateSyncActionNoContent, error) {
   115  	// TODO: Validate the params before sending
   116  	if params == nil {
   117  		params = NewCreateSyncActionParams()
   118  	}
   119  
   120  	result, err := a.transport.Submit(&runtime.ClientOperation{
   121  		ID:                 "createSyncAction",
   122  		Method:             "PUT",
   123  		PathPattern:        "/actions",
   124  		ProducesMediaTypes: []string{"application/json"},
   125  		ConsumesMediaTypes: []string{"application/json"},
   126  		Schemes:            []string{"http"},
   127  		Params:             params,
   128  		Reader:             &CreateSyncActionReader{formats: a.formats},
   129  		Context:            params.Context,
   130  		Client:             params.HTTPClient,
   131  	})
   132  	if err != nil {
   133  		return nil, err
   134  	}
   135  	return result.(*CreateSyncActionNoContent), nil
   136  
   137  }
   138  
   139  /*
   140  DescribeInstance returns general information about an instance
   141  */
   142  func (a *Client) DescribeInstance(params *DescribeInstanceParams) (*DescribeInstanceOK, error) {
   143  	// TODO: Validate the params before sending
   144  	if params == nil {
   145  		params = NewDescribeInstanceParams()
   146  	}
   147  
   148  	result, err := a.transport.Submit(&runtime.ClientOperation{
   149  		ID:                 "describeInstance",
   150  		Method:             "GET",
   151  		PathPattern:        "/",
   152  		ProducesMediaTypes: []string{"application/json"},
   153  		ConsumesMediaTypes: []string{"application/json"},
   154  		Schemes:            []string{"http"},
   155  		Params:             params,
   156  		Reader:             &DescribeInstanceReader{formats: a.formats},
   157  		Context:            params.Context,
   158  		Client:             params.HTTPClient,
   159  	})
   160  	if err != nil {
   161  		return nil, err
   162  	}
   163  	return result.(*DescribeInstanceOK), nil
   164  
   165  }
   166  
   167  /*
   168  GetMachineConfiguration gets the machine configuration of the VM
   169  
   170  Gets the machine configuration of the VM. When called before the PUT operation, it will return the default values for the vCPU count (=1), memory size (=128 MiB). By default Hyperthreading is disabled and there is no CPU Template.
   171  */
   172  func (a *Client) GetMachineConfiguration(params *GetMachineConfigurationParams) (*GetMachineConfigurationOK, error) {
   173  	// TODO: Validate the params before sending
   174  	if params == nil {
   175  		params = NewGetMachineConfigurationParams()
   176  	}
   177  
   178  	result, err := a.transport.Submit(&runtime.ClientOperation{
   179  		ID:                 "getMachineConfiguration",
   180  		Method:             "GET",
   181  		PathPattern:        "/machine-config",
   182  		ProducesMediaTypes: []string{"application/json"},
   183  		ConsumesMediaTypes: []string{"application/json"},
   184  		Schemes:            []string{"http"},
   185  		Params:             params,
   186  		Reader:             &GetMachineConfigurationReader{formats: a.formats},
   187  		Context:            params.Context,
   188  		Client:             params.HTTPClient,
   189  	})
   190  	if err != nil {
   191  		return nil, err
   192  	}
   193  	return result.(*GetMachineConfigurationOK), nil
   194  
   195  }
   196  
   197  /*
   198  PatchGuestDriveByID updates the properties of a drive
   199  
   200  Updates the properties of the drive with the ID specified by drive_id path parameter. Will fail if update is not possible.
   201  */
   202  func (a *Client) PatchGuestDriveByID(params *PatchGuestDriveByIDParams) (*PatchGuestDriveByIDNoContent, error) {
   203  	// TODO: Validate the params before sending
   204  	if params == nil {
   205  		params = NewPatchGuestDriveByIDParams()
   206  	}
   207  
   208  	result, err := a.transport.Submit(&runtime.ClientOperation{
   209  		ID:                 "patchGuestDriveByID",
   210  		Method:             "PATCH",
   211  		PathPattern:        "/drives/{drive_id}",
   212  		ProducesMediaTypes: []string{"application/json"},
   213  		ConsumesMediaTypes: []string{"application/json"},
   214  		Schemes:            []string{"http"},
   215  		Params:             params,
   216  		Reader:             &PatchGuestDriveByIDReader{formats: a.formats},
   217  		Context:            params.Context,
   218  		Client:             params.HTTPClient,
   219  	})
   220  	if err != nil {
   221  		return nil, err
   222  	}
   223  	return result.(*PatchGuestDriveByIDNoContent), nil
   224  
   225  }
   226  
   227  /*
   228  PatchGuestNetworkInterfaceByID updates the rate limiters applied to a network interface
   229  
   230  Updates the rate limiters applied to a network interface.
   231  */
   232  func (a *Client) PatchGuestNetworkInterfaceByID(params *PatchGuestNetworkInterfaceByIDParams) (*PatchGuestNetworkInterfaceByIDNoContent, error) {
   233  	// TODO: Validate the params before sending
   234  	if params == nil {
   235  		params = NewPatchGuestNetworkInterfaceByIDParams()
   236  	}
   237  
   238  	result, err := a.transport.Submit(&runtime.ClientOperation{
   239  		ID:                 "patchGuestNetworkInterfaceByID",
   240  		Method:             "PATCH",
   241  		PathPattern:        "/network-interfaces/{iface_id}",
   242  		ProducesMediaTypes: []string{"application/json"},
   243  		ConsumesMediaTypes: []string{"application/json"},
   244  		Schemes:            []string{"http"},
   245  		Params:             params,
   246  		Reader:             &PatchGuestNetworkInterfaceByIDReader{formats: a.formats},
   247  		Context:            params.Context,
   248  		Client:             params.HTTPClient,
   249  	})
   250  	if err != nil {
   251  		return nil, err
   252  	}
   253  	return result.(*PatchGuestNetworkInterfaceByIDNoContent), nil
   254  
   255  }
   256  
   257  /*
   258  PatchMachineConfiguration partiallies updates the machine configuration of the VM
   259  
   260  Partially updates the Virtual Machine Configuration with the specified input. If any of the parameters has an incorrect value, the whole update fails.
   261  */
   262  func (a *Client) PatchMachineConfiguration(params *PatchMachineConfigurationParams) (*PatchMachineConfigurationNoContent, error) {
   263  	// TODO: Validate the params before sending
   264  	if params == nil {
   265  		params = NewPatchMachineConfigurationParams()
   266  	}
   267  
   268  	result, err := a.transport.Submit(&runtime.ClientOperation{
   269  		ID:                 "patchMachineConfiguration",
   270  		Method:             "PATCH",
   271  		PathPattern:        "/machine-config",
   272  		ProducesMediaTypes: []string{"application/json"},
   273  		ConsumesMediaTypes: []string{"application/json"},
   274  		Schemes:            []string{"http"},
   275  		Params:             params,
   276  		Reader:             &PatchMachineConfigurationReader{formats: a.formats},
   277  		Context:            params.Context,
   278  		Client:             params.HTTPClient,
   279  	})
   280  	if err != nil {
   281  		return nil, err
   282  	}
   283  	return result.(*PatchMachineConfigurationNoContent), nil
   284  
   285  }
   286  
   287  /*
   288  PutGuestBootSource creates or updates the boot source
   289  
   290  Creates new boot source if one does not already exist, otherwise updates it. Will fail if update is not possible. Note that the only currently supported boot source is LocalImage.
   291  */
   292  func (a *Client) PutGuestBootSource(params *PutGuestBootSourceParams) (*PutGuestBootSourceNoContent, error) {
   293  	// TODO: Validate the params before sending
   294  	if params == nil {
   295  		params = NewPutGuestBootSourceParams()
   296  	}
   297  
   298  	result, err := a.transport.Submit(&runtime.ClientOperation{
   299  		ID:                 "putGuestBootSource",
   300  		Method:             "PUT",
   301  		PathPattern:        "/boot-source",
   302  		ProducesMediaTypes: []string{"application/json"},
   303  		ConsumesMediaTypes: []string{"application/json"},
   304  		Schemes:            []string{"http"},
   305  		Params:             params,
   306  		Reader:             &PutGuestBootSourceReader{formats: a.formats},
   307  		Context:            params.Context,
   308  		Client:             params.HTTPClient,
   309  	})
   310  	if err != nil {
   311  		return nil, err
   312  	}
   313  	return result.(*PutGuestBootSourceNoContent), nil
   314  
   315  }
   316  
   317  /*
   318  PutGuestDriveByID creates or updates a drive
   319  
   320  Creates new drive with ID specified by drive_id path parameter. If a drive with the specified ID already exists, updates its state based on new input. Will fail if update is not possible.
   321  */
   322  func (a *Client) PutGuestDriveByID(params *PutGuestDriveByIDParams) (*PutGuestDriveByIDNoContent, error) {
   323  	// TODO: Validate the params before sending
   324  	if params == nil {
   325  		params = NewPutGuestDriveByIDParams()
   326  	}
   327  
   328  	result, err := a.transport.Submit(&runtime.ClientOperation{
   329  		ID:                 "putGuestDriveByID",
   330  		Method:             "PUT",
   331  		PathPattern:        "/drives/{drive_id}",
   332  		ProducesMediaTypes: []string{"application/json"},
   333  		ConsumesMediaTypes: []string{"application/json"},
   334  		Schemes:            []string{"http"},
   335  		Params:             params,
   336  		Reader:             &PutGuestDriveByIDReader{formats: a.formats},
   337  		Context:            params.Context,
   338  		Client:             params.HTTPClient,
   339  	})
   340  	if err != nil {
   341  		return nil, err
   342  	}
   343  	return result.(*PutGuestDriveByIDNoContent), nil
   344  
   345  }
   346  
   347  /*
   348  PutGuestNetworkInterfaceByID creates a network interface
   349  
   350  Creates new network interface with ID specified by iface_id path parameter.
   351  */
   352  func (a *Client) PutGuestNetworkInterfaceByID(params *PutGuestNetworkInterfaceByIDParams) (*PutGuestNetworkInterfaceByIDNoContent, error) {
   353  	// TODO: Validate the params before sending
   354  	if params == nil {
   355  		params = NewPutGuestNetworkInterfaceByIDParams()
   356  	}
   357  
   358  	result, err := a.transport.Submit(&runtime.ClientOperation{
   359  		ID:                 "putGuestNetworkInterfaceByID",
   360  		Method:             "PUT",
   361  		PathPattern:        "/network-interfaces/{iface_id}",
   362  		ProducesMediaTypes: []string{"application/json"},
   363  		ConsumesMediaTypes: []string{"application/json"},
   364  		Schemes:            []string{"http"},
   365  		Params:             params,
   366  		Reader:             &PutGuestNetworkInterfaceByIDReader{formats: a.formats},
   367  		Context:            params.Context,
   368  		Client:             params.HTTPClient,
   369  	})
   370  	if err != nil {
   371  		return nil, err
   372  	}
   373  	return result.(*PutGuestNetworkInterfaceByIDNoContent), nil
   374  
   375  }
   376  
   377  /*
   378  PutGuestVsock creates updates a vsock device
   379  
   380  The first call creates the device with the configuration specified in body. Subsequent calls will update the device configuration. May fail if update is not possible.
   381  */
   382  func (a *Client) PutGuestVsock(params *PutGuestVsockParams) (*PutGuestVsockNoContent, error) {
   383  	// TODO: Validate the params before sending
   384  	if params == nil {
   385  		params = NewPutGuestVsockParams()
   386  	}
   387  
   388  	result, err := a.transport.Submit(&runtime.ClientOperation{
   389  		ID:                 "putGuestVsock",
   390  		Method:             "PUT",
   391  		PathPattern:        "/vsock",
   392  		ProducesMediaTypes: []string{"application/json"},
   393  		ConsumesMediaTypes: []string{"application/json"},
   394  		Schemes:            []string{"http"},
   395  		Params:             params,
   396  		Reader:             &PutGuestVsockReader{formats: a.formats},
   397  		Context:            params.Context,
   398  		Client:             params.HTTPClient,
   399  	})
   400  	if err != nil {
   401  		return nil, err
   402  	}
   403  	return result.(*PutGuestVsockNoContent), nil
   404  
   405  }
   406  
   407  /*
   408  PutLogger initializes the logger by specifying two named pipes i e for the logs and metrics output
   409  */
   410  func (a *Client) PutLogger(params *PutLoggerParams) (*PutLoggerNoContent, error) {
   411  	// TODO: Validate the params before sending
   412  	if params == nil {
   413  		params = NewPutLoggerParams()
   414  	}
   415  
   416  	result, err := a.transport.Submit(&runtime.ClientOperation{
   417  		ID:                 "putLogger",
   418  		Method:             "PUT",
   419  		PathPattern:        "/logger",
   420  		ProducesMediaTypes: []string{"application/json"},
   421  		ConsumesMediaTypes: []string{"application/json"},
   422  		Schemes:            []string{"http"},
   423  		Params:             params,
   424  		Reader:             &PutLoggerReader{formats: a.formats},
   425  		Context:            params.Context,
   426  		Client:             params.HTTPClient,
   427  	})
   428  	if err != nil {
   429  		return nil, err
   430  	}
   431  	return result.(*PutLoggerNoContent), nil
   432  
   433  }
   434  
   435  /*
   436  PutMachineConfiguration updates the machine configuration of the VM
   437  
   438  Updates the Virtual Machine Configuration with the specified input. Firecracker starts with default values for vCPU count (=1) and memory size (=128 MiB). With Hyperthreading enabled, the vCPU count is restricted to be 1 or an even number, otherwise there are no restrictions regarding the vCPU count. If any of the parameters has an incorrect value, the whole update fails.
   439  */
   440  func (a *Client) PutMachineConfiguration(params *PutMachineConfigurationParams) (*PutMachineConfigurationNoContent, error) {
   441  	// TODO: Validate the params before sending
   442  	if params == nil {
   443  		params = NewPutMachineConfigurationParams()
   444  	}
   445  
   446  	result, err := a.transport.Submit(&runtime.ClientOperation{
   447  		ID:                 "putMachineConfiguration",
   448  		Method:             "PUT",
   449  		PathPattern:        "/machine-config",
   450  		ProducesMediaTypes: []string{"application/json"},
   451  		ConsumesMediaTypes: []string{"application/json"},
   452  		Schemes:            []string{"http"},
   453  		Params:             params,
   454  		Reader:             &PutMachineConfigurationReader{formats: a.formats},
   455  		Context:            params.Context,
   456  		Client:             params.HTTPClient,
   457  	})
   458  	if err != nil {
   459  		return nil, err
   460  	}
   461  	return result.(*PutMachineConfigurationNoContent), nil
   462  
   463  }
   464  
   465  // SetTransport changes the transport on the client
   466  func (a *Client) SetTransport(transport runtime.ClientTransport) {
   467  	a.transport = transport
   468  }