github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/systeminfo/systeminfo_client.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package systeminfo 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 "context" 10 "io" 11 12 "github.com/go-openapi/runtime" 13 14 strfmt "github.com/go-openapi/strfmt" 15 ) 16 17 //go:generate mockery -name API -inpkg 18 19 // API is the interface of the systeminfo client 20 type API interface { 21 /* 22 GetCert gets default root certificate 23 24 This endpoint is for downloading a default root certificate. 25 */ 26 GetCert(ctx context.Context, params *GetCertParams, writer io.Writer) (*GetCertOK, error) 27 /* 28 GetSystemInfo gets general system info 29 30 This API is for retrieving general system info, this can be called by anonymous request. Some attributes will be omitted in the response when this API is called by anonymous request. 31 */ 32 GetSystemInfo(ctx context.Context, params *GetSystemInfoParams) (*GetSystemInfoOK, error) 33 /* 34 GetVolumes gets system volume info total free size 35 36 This endpoint is for retrieving system volume info that only provides for admin user. Note that the response only reflects the storage status of local disk. 37 */ 38 GetVolumes(ctx context.Context, params *GetVolumesParams) (*GetVolumesOK, error) 39 } 40 41 // New creates a new systeminfo API client. 42 func New(transport runtime.ClientTransport, formats strfmt.Registry, authInfo runtime.ClientAuthInfoWriter) *Client { 43 return &Client{ 44 transport: transport, 45 formats: formats, 46 authInfo: authInfo, 47 } 48 } 49 50 /* 51 Client for systeminfo API 52 */ 53 type Client struct { 54 transport runtime.ClientTransport 55 formats strfmt.Registry 56 authInfo runtime.ClientAuthInfoWriter 57 } 58 59 /* 60 GetCert gets default root certificate 61 62 This endpoint is for downloading a default root certificate. 63 */ 64 func (a *Client) GetCert(ctx context.Context, params *GetCertParams, writer io.Writer) (*GetCertOK, error) { 65 66 result, err := a.transport.Submit(&runtime.ClientOperation{ 67 ID: "getCert", 68 Method: "GET", 69 PathPattern: "/systeminfo/getcert", 70 ProducesMediaTypes: []string{"application/octet-stream"}, 71 ConsumesMediaTypes: []string{"application/json"}, 72 Schemes: []string{"http", "https"}, 73 Params: params, 74 Reader: &GetCertReader{formats: a.formats, writer: writer}, 75 AuthInfo: a.authInfo, 76 Context: ctx, 77 Client: params.HTTPClient, 78 }) 79 if err != nil { 80 return nil, err 81 } 82 return result.(*GetCertOK), nil 83 84 } 85 86 /* 87 GetSystemInfo gets general system info 88 89 This API is for retrieving general system info, this can be called by anonymous request. Some attributes will be omitted in the response when this API is called by anonymous request. 90 */ 91 func (a *Client) GetSystemInfo(ctx context.Context, params *GetSystemInfoParams) (*GetSystemInfoOK, error) { 92 93 result, err := a.transport.Submit(&runtime.ClientOperation{ 94 ID: "getSystemInfo", 95 Method: "GET", 96 PathPattern: "/systeminfo", 97 ProducesMediaTypes: []string{"application/json"}, 98 ConsumesMediaTypes: []string{"application/json"}, 99 Schemes: []string{"http", "https"}, 100 Params: params, 101 Reader: &GetSystemInfoReader{formats: a.formats}, 102 AuthInfo: a.authInfo, 103 Context: ctx, 104 Client: params.HTTPClient, 105 }) 106 if err != nil { 107 return nil, err 108 } 109 return result.(*GetSystemInfoOK), nil 110 111 } 112 113 /* 114 GetVolumes gets system volume info total free size 115 116 This endpoint is for retrieving system volume info that only provides for admin user. Note that the response only reflects the storage status of local disk. 117 */ 118 func (a *Client) GetVolumes(ctx context.Context, params *GetVolumesParams) (*GetVolumesOK, error) { 119 120 result, err := a.transport.Submit(&runtime.ClientOperation{ 121 ID: "getVolumes", 122 Method: "GET", 123 PathPattern: "/systeminfo/volumes", 124 ProducesMediaTypes: []string{"application/json"}, 125 ConsumesMediaTypes: []string{"application/json"}, 126 Schemes: []string{"http", "https"}, 127 Params: params, 128 Reader: &GetVolumesReader{formats: a.formats}, 129 AuthInfo: a.authInfo, 130 Context: ctx, 131 Client: params.HTTPClient, 132 }) 133 if err != nil { 134 return nil, err 135 } 136 return result.(*GetVolumesOK), nil 137 138 }