From 9cfd4646f80eef181147ddf502e873a2bd8be478 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Mon, 2 Jun 2025 16:25:29 -0400 Subject: [PATCH] /agent/status api endpoint rough-in (#967) --- rest_client_zrok/agent/agent_client.go | 41 ++ .../agent/remote_status_parameters.go | 146 +++++ .../agent/remote_status_responses.go | 607 ++++++++++++++++++ rest_client_zrok/agent/unenroll_responses.go | 2 +- rest_server_zrok/embedded_spec.go | 214 +++++- .../operations/agent/remote_status.go | 385 +++++++++++ .../agent/remote_status_parameters.go | 74 +++ .../agent/remote_status_responses.go | 132 ++++ .../agent/remote_status_urlbuilder.go | 87 +++ .../operations/agent/unenroll_responses.go | 2 +- rest_server_zrok/operations/zrok_api.go | 12 + .../sdk/src/api/.openapi-generator/FILES | 3 + sdk/nodejs/sdk/src/api/apis/AgentApi.ts | 38 ++ .../src/api/models/RemoteStatus200Response.ts | 88 +++ .../RemoteStatus200ResponseAccessesInner.ts | 89 +++ .../RemoteStatus200ResponseSharesInner.ts | 121 ++++ sdk/nodejs/sdk/src/api/models/index.ts | 3 + sdk/python/src/.openapi-generator/FILES | 9 + sdk/python/src/README.md | 4 + sdk/python/src/docs/AgentApi.md | 80 +++ .../src/docs/RemoteStatus200Response.md | 30 + .../RemoteStatus200ResponseAccessesInner.md | 32 + .../RemoteStatus200ResponseSharesInner.md | 36 ++ sdk/python/src/test/test_agent_api.py | 6 + .../test/test_remote_status200_response.py | 72 +++ ...emote_status200_response_accesses_inner.py | 56 ++ ..._remote_status200_response_shares_inner.py | 60 ++ sdk/python/src/zrok_api/__init__.py | 3 + sdk/python/src/zrok_api/api/agent_api.py | 284 ++++++++ sdk/python/src/zrok_api/models/__init__.py | 3 + .../models/remote_status200_response.py | 105 +++ ...emote_status200_response_accesses_inner.py | 93 +++ .../remote_status200_response_shares_inner.py | 101 +++ specs/zrok.yml | 65 ++ ui/src/api/.openapi-generator/FILES | 3 + ui/src/api/apis/AgentApi.ts | 38 ++ ui/src/api/models/RemoteStatus200Response.ts | 88 +++ .../RemoteStatus200ResponseAccessesInner.ts | 89 +++ .../RemoteStatus200ResponseSharesInner.ts | 121 ++++ ui/src/api/models/index.ts | 3 + 40 files changed, 3421 insertions(+), 4 deletions(-) create mode 100644 rest_client_zrok/agent/remote_status_parameters.go create mode 100644 rest_client_zrok/agent/remote_status_responses.go create mode 100644 rest_server_zrok/operations/agent/remote_status.go create mode 100644 rest_server_zrok/operations/agent/remote_status_parameters.go create mode 100644 rest_server_zrok/operations/agent/remote_status_responses.go create mode 100644 rest_server_zrok/operations/agent/remote_status_urlbuilder.go create mode 100644 sdk/nodejs/sdk/src/api/models/RemoteStatus200Response.ts create mode 100644 sdk/nodejs/sdk/src/api/models/RemoteStatus200ResponseAccessesInner.ts create mode 100644 sdk/nodejs/sdk/src/api/models/RemoteStatus200ResponseSharesInner.ts create mode 100644 sdk/python/src/docs/RemoteStatus200Response.md create mode 100644 sdk/python/src/docs/RemoteStatus200ResponseAccessesInner.md create mode 100644 sdk/python/src/docs/RemoteStatus200ResponseSharesInner.md create mode 100644 sdk/python/src/test/test_remote_status200_response.py create mode 100644 sdk/python/src/test/test_remote_status200_response_accesses_inner.py create mode 100644 sdk/python/src/test/test_remote_status200_response_shares_inner.py create mode 100644 sdk/python/src/zrok_api/models/remote_status200_response.py create mode 100644 sdk/python/src/zrok_api/models/remote_status200_response_accesses_inner.py create mode 100644 sdk/python/src/zrok_api/models/remote_status200_response_shares_inner.py create mode 100644 ui/src/api/models/RemoteStatus200Response.ts create mode 100644 ui/src/api/models/RemoteStatus200ResponseAccessesInner.ts create mode 100644 ui/src/api/models/RemoteStatus200ResponseSharesInner.ts diff --git a/rest_client_zrok/agent/agent_client.go b/rest_client_zrok/agent/agent_client.go index a062d502..ea83391f 100644 --- a/rest_client_zrok/agent/agent_client.go +++ b/rest_client_zrok/agent/agent_client.go @@ -106,6 +106,8 @@ type ClientService interface { RemoteShare(params *RemoteShareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoteShareOK, error) + RemoteStatus(params *RemoteStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoteStatusOK, error) + RemoteUnshare(params *RemoteUnshareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoteUnshareOK, error) Unenroll(params *UnenrollParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnenrollOK, error) @@ -230,6 +232,45 @@ func (a *Client) RemoteShare(params *RemoteShareParams, authInfo runtime.ClientA panic(msg) } +/* +RemoteStatus remote status API +*/ +func (a *Client) RemoteStatus(params *RemoteStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoteStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRemoteStatusParams() + } + op := &runtime.ClientOperation{ + ID: "remoteStatus", + Method: "POST", + PathPattern: "/agent/status", + ProducesMediaTypes: []string{"application/zrok.v1+json"}, + ConsumesMediaTypes: []string{"application/zrok.v1+json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &RemoteStatusReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RemoteStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for remoteStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* RemoteUnshare remote unshare API */ diff --git a/rest_client_zrok/agent/remote_status_parameters.go b/rest_client_zrok/agent/remote_status_parameters.go new file mode 100644 index 00000000..43a617cd --- /dev/null +++ b/rest_client_zrok/agent/remote_status_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// 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" +) + +// NewRemoteStatusParams creates a new RemoteStatusParams 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 NewRemoteStatusParams() *RemoteStatusParams { + return &RemoteStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRemoteStatusParamsWithTimeout creates a new RemoteStatusParams object +// with the ability to set a timeout on a request. +func NewRemoteStatusParamsWithTimeout(timeout time.Duration) *RemoteStatusParams { + return &RemoteStatusParams{ + timeout: timeout, + } +} + +// NewRemoteStatusParamsWithContext creates a new RemoteStatusParams object +// with the ability to set a context for a request. +func NewRemoteStatusParamsWithContext(ctx context.Context) *RemoteStatusParams { + return &RemoteStatusParams{ + Context: ctx, + } +} + +// NewRemoteStatusParamsWithHTTPClient creates a new RemoteStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewRemoteStatusParamsWithHTTPClient(client *http.Client) *RemoteStatusParams { + return &RemoteStatusParams{ + HTTPClient: client, + } +} + +/* +RemoteStatusParams contains all the parameters to send to the API endpoint + + for the remote status operation. + + Typically these are written to a http.Request. +*/ +type RemoteStatusParams struct { + + // Body. + Body RemoteStatusBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the remote status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RemoteStatusParams) WithDefaults() *RemoteStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the remote status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RemoteStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the remote status params +func (o *RemoteStatusParams) WithTimeout(timeout time.Duration) *RemoteStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the remote status params +func (o *RemoteStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the remote status params +func (o *RemoteStatusParams) WithContext(ctx context.Context) *RemoteStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the remote status params +func (o *RemoteStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the remote status params +func (o *RemoteStatusParams) WithHTTPClient(client *http.Client) *RemoteStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the remote status params +func (o *RemoteStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the remote status params +func (o *RemoteStatusParams) WithBody(body RemoteStatusBody) *RemoteStatusParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the remote status params +func (o *RemoteStatusParams) SetBody(body RemoteStatusBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *RemoteStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/rest_client_zrok/agent/remote_status_responses.go b/rest_client_zrok/agent/remote_status_responses.go new file mode 100644 index 00000000..bcbe0f61 --- /dev/null +++ b/rest_client_zrok/agent/remote_status_responses.go @@ -0,0 +1,607 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RemoteStatusReader is a Reader for the RemoteStatus structure. +type RemoteStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RemoteStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRemoteStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewRemoteStatusUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewRemoteStatusInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 502: + result := NewRemoteStatusBadGateway() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /agent/status] remoteStatus", response, response.Code()) + } +} + +// NewRemoteStatusOK creates a RemoteStatusOK with default headers values +func NewRemoteStatusOK() *RemoteStatusOK { + return &RemoteStatusOK{} +} + +/* +RemoteStatusOK describes a response with status code 200, with default header values. + +ok +*/ +type RemoteStatusOK struct { + Payload *RemoteStatusOKBody +} + +// IsSuccess returns true when this remote status o k response has a 2xx status code +func (o *RemoteStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this remote status o k response has a 3xx status code +func (o *RemoteStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this remote status o k response has a 4xx status code +func (o *RemoteStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this remote status o k response has a 5xx status code +func (o *RemoteStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this remote status o k response a status code equal to that given +func (o *RemoteStatusOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the remote status o k response +func (o *RemoteStatusOK) Code() int { + return 200 +} + +func (o *RemoteStatusOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /agent/status][%d] remoteStatusOK %s", 200, payload) +} + +func (o *RemoteStatusOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /agent/status][%d] remoteStatusOK %s", 200, payload) +} + +func (o *RemoteStatusOK) GetPayload() *RemoteStatusOKBody { + return o.Payload +} + +func (o *RemoteStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(RemoteStatusOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRemoteStatusUnauthorized creates a RemoteStatusUnauthorized with default headers values +func NewRemoteStatusUnauthorized() *RemoteStatusUnauthorized { + return &RemoteStatusUnauthorized{} +} + +/* +RemoteStatusUnauthorized describes a response with status code 401, with default header values. + +unauthorized +*/ +type RemoteStatusUnauthorized struct { +} + +// IsSuccess returns true when this remote status unauthorized response has a 2xx status code +func (o *RemoteStatusUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this remote status unauthorized response has a 3xx status code +func (o *RemoteStatusUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this remote status unauthorized response has a 4xx status code +func (o *RemoteStatusUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this remote status unauthorized response has a 5xx status code +func (o *RemoteStatusUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this remote status unauthorized response a status code equal to that given +func (o *RemoteStatusUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the remote status unauthorized response +func (o *RemoteStatusUnauthorized) Code() int { + return 401 +} + +func (o *RemoteStatusUnauthorized) Error() string { + return fmt.Sprintf("[POST /agent/status][%d] remoteStatusUnauthorized", 401) +} + +func (o *RemoteStatusUnauthorized) String() string { + return fmt.Sprintf("[POST /agent/status][%d] remoteStatusUnauthorized", 401) +} + +func (o *RemoteStatusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRemoteStatusInternalServerError creates a RemoteStatusInternalServerError with default headers values +func NewRemoteStatusInternalServerError() *RemoteStatusInternalServerError { + return &RemoteStatusInternalServerError{} +} + +/* +RemoteStatusInternalServerError describes a response with status code 500, with default header values. + +internal server error +*/ +type RemoteStatusInternalServerError struct { +} + +// IsSuccess returns true when this remote status internal server error response has a 2xx status code +func (o *RemoteStatusInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this remote status internal server error response has a 3xx status code +func (o *RemoteStatusInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this remote status internal server error response has a 4xx status code +func (o *RemoteStatusInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this remote status internal server error response has a 5xx status code +func (o *RemoteStatusInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this remote status internal server error response a status code equal to that given +func (o *RemoteStatusInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the remote status internal server error response +func (o *RemoteStatusInternalServerError) Code() int { + return 500 +} + +func (o *RemoteStatusInternalServerError) Error() string { + return fmt.Sprintf("[POST /agent/status][%d] remoteStatusInternalServerError", 500) +} + +func (o *RemoteStatusInternalServerError) String() string { + return fmt.Sprintf("[POST /agent/status][%d] remoteStatusInternalServerError", 500) +} + +func (o *RemoteStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRemoteStatusBadGateway creates a RemoteStatusBadGateway with default headers values +func NewRemoteStatusBadGateway() *RemoteStatusBadGateway { + return &RemoteStatusBadGateway{} +} + +/* +RemoteStatusBadGateway describes a response with status code 502, with default header values. + +bad gateway; agent not reachable +*/ +type RemoteStatusBadGateway struct { +} + +// IsSuccess returns true when this remote status bad gateway response has a 2xx status code +func (o *RemoteStatusBadGateway) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this remote status bad gateway response has a 3xx status code +func (o *RemoteStatusBadGateway) IsRedirect() bool { + return false +} + +// IsClientError returns true when this remote status bad gateway response has a 4xx status code +func (o *RemoteStatusBadGateway) IsClientError() bool { + return false +} + +// IsServerError returns true when this remote status bad gateway response has a 5xx status code +func (o *RemoteStatusBadGateway) IsServerError() bool { + return true +} + +// IsCode returns true when this remote status bad gateway response a status code equal to that given +func (o *RemoteStatusBadGateway) IsCode(code int) bool { + return code == 502 +} + +// Code gets the status code for the remote status bad gateway response +func (o *RemoteStatusBadGateway) Code() int { + return 502 +} + +func (o *RemoteStatusBadGateway) Error() string { + return fmt.Sprintf("[POST /agent/status][%d] remoteStatusBadGateway", 502) +} + +func (o *RemoteStatusBadGateway) String() string { + return fmt.Sprintf("[POST /agent/status][%d] remoteStatusBadGateway", 502) +} + +func (o *RemoteStatusBadGateway) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +/* +RemoteStatusBody remote status body +swagger:model RemoteStatusBody +*/ +type RemoteStatusBody struct { + + // env z Id + EnvZID string `json:"envZId,omitempty"` +} + +// Validate validates this remote status body +func (o *RemoteStatusBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this remote status body based on context it is used +func (o *RemoteStatusBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *RemoteStatusBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoteStatusBody) UnmarshalBinary(b []byte) error { + var res RemoteStatusBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +RemoteStatusOKBody remote status o k body +swagger:model RemoteStatusOKBody +*/ +type RemoteStatusOKBody struct { + + // accesses + Accesses []*RemoteStatusOKBodyAccessesItems0 `json:"accesses"` + + // shares + Shares []*RemoteStatusOKBodySharesItems0 `json:"shares"` +} + +// Validate validates this remote status o k body +func (o *RemoteStatusOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateAccesses(formats); err != nil { + res = append(res, err) + } + + if err := o.validateShares(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *RemoteStatusOKBody) validateAccesses(formats strfmt.Registry) error { + if swag.IsZero(o.Accesses) { // not required + return nil + } + + for i := 0; i < len(o.Accesses); i++ { + if swag.IsZero(o.Accesses[i]) { // not required + continue + } + + if o.Accesses[i] != nil { + if err := o.Accesses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remoteStatusOK" + "." + "accesses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("remoteStatusOK" + "." + "accesses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *RemoteStatusOKBody) validateShares(formats strfmt.Registry) error { + if swag.IsZero(o.Shares) { // not required + return nil + } + + for i := 0; i < len(o.Shares); i++ { + if swag.IsZero(o.Shares[i]) { // not required + continue + } + + if o.Shares[i] != nil { + if err := o.Shares[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remoteStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("remoteStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this remote status o k body based on the context it is used +func (o *RemoteStatusOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateAccesses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateShares(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *RemoteStatusOKBody) contextValidateAccesses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Accesses); i++ { + + if o.Accesses[i] != nil { + + if swag.IsZero(o.Accesses[i]) { // not required + return nil + } + + if err := o.Accesses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remoteStatusOK" + "." + "accesses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("remoteStatusOK" + "." + "accesses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *RemoteStatusOKBody) contextValidateShares(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Shares); i++ { + + if o.Shares[i] != nil { + + if swag.IsZero(o.Shares[i]) { // not required + return nil + } + + if err := o.Shares[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remoteStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("remoteStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *RemoteStatusOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoteStatusOKBody) UnmarshalBinary(b []byte) error { + var res RemoteStatusOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +RemoteStatusOKBodyAccessesItems0 remote status o k body accesses items0 +swagger:model RemoteStatusOKBodyAccessesItems0 +*/ +type RemoteStatusOKBodyAccessesItems0 struct { + + // bind address + BindAddress string `json:"bindAddress,omitempty"` + + // frontend token + FrontendToken string `json:"frontendToken,omitempty"` + + // response headers + ResponseHeaders []string `json:"responseHeaders"` + + // token + Token string `json:"token,omitempty"` +} + +// Validate validates this remote status o k body accesses items0 +func (o *RemoteStatusOKBodyAccessesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this remote status o k body accesses items0 based on context it is used +func (o *RemoteStatusOKBodyAccessesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *RemoteStatusOKBodyAccessesItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoteStatusOKBodyAccessesItems0) UnmarshalBinary(b []byte) error { + var res RemoteStatusOKBodyAccessesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +RemoteStatusOKBodySharesItems0 remote status o k body shares items0 +swagger:model RemoteStatusOKBodySharesItems0 +*/ +type RemoteStatusOKBodySharesItems0 struct { + + // backend endpoint + BackendEndpoint string `json:"backendEndpoint,omitempty"` + + // backend mode + BackendMode string `json:"backendMode,omitempty"` + + // frontend endpoints + FrontendEndpoints []string `json:"frontendEndpoints"` + + // open + Open bool `json:"open,omitempty"` + + // reserved + Reserved bool `json:"reserved,omitempty"` + + // share mode + ShareMode string `json:"shareMode,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // token + Token string `json:"token,omitempty"` +} + +// Validate validates this remote status o k body shares items0 +func (o *RemoteStatusOKBodySharesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this remote status o k body shares items0 based on context it is used +func (o *RemoteStatusOKBodySharesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *RemoteStatusOKBodySharesItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoteStatusOKBodySharesItems0) UnmarshalBinary(b []byte) error { + var res RemoteStatusOKBodySharesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/rest_client_zrok/agent/unenroll_responses.go b/rest_client_zrok/agent/unenroll_responses.go index be78d236..03b85c46 100644 --- a/rest_client_zrok/agent/unenroll_responses.go +++ b/rest_client_zrok/agent/unenroll_responses.go @@ -227,7 +227,7 @@ func NewUnenrollInternalServerError() *UnenrollInternalServerError { /* UnenrollInternalServerError describes a response with status code 500, with default header values. -UnenrollInternalServerError unenroll internal server error +internal server error */ type UnenrollInternalServerError struct { } diff --git a/rest_server_zrok/embedded_spec.go b/rest_server_zrok/embedded_spec.go index 108f886e..40a349ee 100644 --- a/rest_server_zrok/embedded_spec.go +++ b/rest_server_zrok/embedded_spec.go @@ -395,6 +395,108 @@ func init() { } } }, + "/agent/status": { + "post": { + "security": [ + { + "key": [] + } + ], + "tags": [ + "agent" + ], + "operationId": "remoteStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "properties": { + "envZId": { + "type": "string" + } + } + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "properties": { + "accesses": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bindAddress": { + "type": "string" + }, + "frontendToken": { + "type": "string" + }, + "responseHeaders": { + "type": "array", + "items": { + "type": "string" + } + }, + "token": { + "type": "string" + } + } + } + }, + "shares": { + "type": "array", + "items": { + "type": "object", + "properties": { + "backendEndpoint": { + "type": "string" + }, + "backendMode": { + "type": "string" + }, + "frontendEndpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "open": { + "type": "boolean" + }, + "reserved": { + "type": "boolean" + }, + "shareMode": { + "type": "string" + }, + "status": { + "type": "string" + }, + "token": { + "type": "string" + } + } + } + } + } + } + }, + "401": { + "description": "unauthorized" + }, + "500": { + "description": "internal server error" + }, + "502": { + "description": "bad gateway; agent not reachable" + } + } + } + }, "/agent/unenroll": { "post": { "security": [ @@ -430,7 +532,7 @@ func init() { "description": "unauthorized" }, "500": { - "description": "" + "description": "internal server error" } } } @@ -2999,6 +3101,62 @@ func init() { } } }, + "/agent/status": { + "post": { + "security": [ + { + "key": [] + } + ], + "tags": [ + "agent" + ], + "operationId": "remoteStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "properties": { + "envZId": { + "type": "string" + } + } + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "properties": { + "accesses": { + "type": "array", + "items": { + "$ref": "#/definitions/AccessesItems0" + } + }, + "shares": { + "type": "array", + "items": { + "$ref": "#/definitions/SharesItems0" + } + } + } + } + }, + "401": { + "description": "unauthorized" + }, + "500": { + "description": "internal server error" + }, + "502": { + "description": "bad gateway; agent not reachable" + } + } + } + }, "/agent/unenroll": { "post": { "security": [ @@ -3034,7 +3192,7 @@ func init() { "description": "unauthorized" }, "500": { - "description": "" + "description": "internal server error" } } } @@ -4811,6 +4969,26 @@ func init() { } }, "definitions": { + "AccessesItems0": { + "type": "object", + "properties": { + "bindAddress": { + "type": "string" + }, + "frontendToken": { + "type": "string" + }, + "responseHeaders": { + "type": "array", + "items": { + "type": "string" + } + }, + "token": { + "type": "string" + } + } + }, "ListFrontendsOKBodyItems0": { "type": "object", "properties": { @@ -4867,6 +5045,38 @@ func init() { } } }, + "SharesItems0": { + "type": "object", + "properties": { + "backendEndpoint": { + "type": "string" + }, + "backendMode": { + "type": "string" + }, + "frontendEndpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "open": { + "type": "boolean" + }, + "reserved": { + "type": "boolean" + }, + "shareMode": { + "type": "string" + }, + "status": { + "type": "string" + }, + "token": { + "type": "string" + } + } + }, "authUser": { "type": "object", "properties": { diff --git a/rest_server_zrok/operations/agent/remote_status.go b/rest_server_zrok/operations/agent/remote_status.go new file mode 100644 index 00000000..9c6e8563 --- /dev/null +++ b/rest_server_zrok/operations/agent/remote_status.go @@ -0,0 +1,385 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "net/http" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/openziti/zrok/rest_model_zrok" +) + +// RemoteStatusHandlerFunc turns a function with the right signature into a remote status handler +type RemoteStatusHandlerFunc func(RemoteStatusParams, *rest_model_zrok.Principal) middleware.Responder + +// Handle executing the request and returning a response +func (fn RemoteStatusHandlerFunc) Handle(params RemoteStatusParams, principal *rest_model_zrok.Principal) middleware.Responder { + return fn(params, principal) +} + +// RemoteStatusHandler interface for that can handle valid remote status params +type RemoteStatusHandler interface { + Handle(RemoteStatusParams, *rest_model_zrok.Principal) middleware.Responder +} + +// NewRemoteStatus creates a new http.Handler for the remote status operation +func NewRemoteStatus(ctx *middleware.Context, handler RemoteStatusHandler) *RemoteStatus { + return &RemoteStatus{Context: ctx, Handler: handler} +} + +/* + RemoteStatus swagger:route POST /agent/status agent remoteStatus + +RemoteStatus remote status API +*/ +type RemoteStatus struct { + Context *middleware.Context + Handler RemoteStatusHandler +} + +func (o *RemoteStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewRemoteStatusParams() + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + *r = *aCtx + } + var principal *rest_model_zrok.Principal + if uprinc != nil { + principal = uprinc.(*rest_model_zrok.Principal) // this is really a rest_model_zrok.Principal, I promise + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} + +// RemoteStatusBody remote status body +// +// swagger:model RemoteStatusBody +type RemoteStatusBody struct { + + // env z Id + EnvZID string `json:"envZId,omitempty"` +} + +// Validate validates this remote status body +func (o *RemoteStatusBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this remote status body based on context it is used +func (o *RemoteStatusBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *RemoteStatusBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoteStatusBody) UnmarshalBinary(b []byte) error { + var res RemoteStatusBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +// RemoteStatusOKBody remote status o k body +// +// swagger:model RemoteStatusOKBody +type RemoteStatusOKBody struct { + + // accesses + Accesses []*RemoteStatusOKBodyAccessesItems0 `json:"accesses"` + + // shares + Shares []*RemoteStatusOKBodySharesItems0 `json:"shares"` +} + +// Validate validates this remote status o k body +func (o *RemoteStatusOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateAccesses(formats); err != nil { + res = append(res, err) + } + + if err := o.validateShares(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *RemoteStatusOKBody) validateAccesses(formats strfmt.Registry) error { + if swag.IsZero(o.Accesses) { // not required + return nil + } + + for i := 0; i < len(o.Accesses); i++ { + if swag.IsZero(o.Accesses[i]) { // not required + continue + } + + if o.Accesses[i] != nil { + if err := o.Accesses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remoteStatusOK" + "." + "accesses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("remoteStatusOK" + "." + "accesses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *RemoteStatusOKBody) validateShares(formats strfmt.Registry) error { + if swag.IsZero(o.Shares) { // not required + return nil + } + + for i := 0; i < len(o.Shares); i++ { + if swag.IsZero(o.Shares[i]) { // not required + continue + } + + if o.Shares[i] != nil { + if err := o.Shares[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remoteStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("remoteStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this remote status o k body based on the context it is used +func (o *RemoteStatusOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateAccesses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateShares(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *RemoteStatusOKBody) contextValidateAccesses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Accesses); i++ { + + if o.Accesses[i] != nil { + + if swag.IsZero(o.Accesses[i]) { // not required + return nil + } + + if err := o.Accesses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remoteStatusOK" + "." + "accesses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("remoteStatusOK" + "." + "accesses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *RemoteStatusOKBody) contextValidateShares(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Shares); i++ { + + if o.Shares[i] != nil { + + if swag.IsZero(o.Shares[i]) { // not required + return nil + } + + if err := o.Shares[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remoteStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("remoteStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *RemoteStatusOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoteStatusOKBody) UnmarshalBinary(b []byte) error { + var res RemoteStatusOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +// RemoteStatusOKBodyAccessesItems0 remote status o k body accesses items0 +// +// swagger:model RemoteStatusOKBodyAccessesItems0 +type RemoteStatusOKBodyAccessesItems0 struct { + + // bind address + BindAddress string `json:"bindAddress,omitempty"` + + // frontend token + FrontendToken string `json:"frontendToken,omitempty"` + + // response headers + ResponseHeaders []string `json:"responseHeaders"` + + // token + Token string `json:"token,omitempty"` +} + +// Validate validates this remote status o k body accesses items0 +func (o *RemoteStatusOKBodyAccessesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this remote status o k body accesses items0 based on context it is used +func (o *RemoteStatusOKBodyAccessesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *RemoteStatusOKBodyAccessesItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoteStatusOKBodyAccessesItems0) UnmarshalBinary(b []byte) error { + var res RemoteStatusOKBodyAccessesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +// RemoteStatusOKBodySharesItems0 remote status o k body shares items0 +// +// swagger:model RemoteStatusOKBodySharesItems0 +type RemoteStatusOKBodySharesItems0 struct { + + // backend endpoint + BackendEndpoint string `json:"backendEndpoint,omitempty"` + + // backend mode + BackendMode string `json:"backendMode,omitempty"` + + // frontend endpoints + FrontendEndpoints []string `json:"frontendEndpoints"` + + // open + Open bool `json:"open,omitempty"` + + // reserved + Reserved bool `json:"reserved,omitempty"` + + // share mode + ShareMode string `json:"shareMode,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // token + Token string `json:"token,omitempty"` +} + +// Validate validates this remote status o k body shares items0 +func (o *RemoteStatusOKBodySharesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this remote status o k body shares items0 based on context it is used +func (o *RemoteStatusOKBodySharesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *RemoteStatusOKBodySharesItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoteStatusOKBodySharesItems0) UnmarshalBinary(b []byte) error { + var res RemoteStatusOKBodySharesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/rest_server_zrok/operations/agent/remote_status_parameters.go b/rest_server_zrok/operations/agent/remote_status_parameters.go new file mode 100644 index 00000000..e09b8d04 --- /dev/null +++ b/rest_server_zrok/operations/agent/remote_status_parameters.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" +) + +// NewRemoteStatusParams creates a new RemoteStatusParams object +// +// There are no default values defined in the spec. +func NewRemoteStatusParams() RemoteStatusParams { + + return RemoteStatusParams{} +} + +// RemoteStatusParams contains all the bound params for the remote status operation +// typically these are obtained from a http.Request +// +// swagger:parameters remoteStatus +type RemoteStatusParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body RemoteStatusBody +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewRemoteStatusParams() beforehand. +func (o *RemoteStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body RemoteStatusBody + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/rest_server_zrok/operations/agent/remote_status_responses.go b/rest_server_zrok/operations/agent/remote_status_responses.go new file mode 100644 index 00000000..d55048bd --- /dev/null +++ b/rest_server_zrok/operations/agent/remote_status_responses.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// RemoteStatusOKCode is the HTTP code returned for type RemoteStatusOK +const RemoteStatusOKCode int = 200 + +/* +RemoteStatusOK ok + +swagger:response remoteStatusOK +*/ +type RemoteStatusOK struct { + + /* + In: Body + */ + Payload *RemoteStatusOKBody `json:"body,omitempty"` +} + +// NewRemoteStatusOK creates RemoteStatusOK with default headers values +func NewRemoteStatusOK() *RemoteStatusOK { + + return &RemoteStatusOK{} +} + +// WithPayload adds the payload to the remote status o k response +func (o *RemoteStatusOK) WithPayload(payload *RemoteStatusOKBody) *RemoteStatusOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the remote status o k response +func (o *RemoteStatusOK) SetPayload(payload *RemoteStatusOKBody) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RemoteStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RemoteStatusUnauthorizedCode is the HTTP code returned for type RemoteStatusUnauthorized +const RemoteStatusUnauthorizedCode int = 401 + +/* +RemoteStatusUnauthorized unauthorized + +swagger:response remoteStatusUnauthorized +*/ +type RemoteStatusUnauthorized struct { +} + +// NewRemoteStatusUnauthorized creates RemoteStatusUnauthorized with default headers values +func NewRemoteStatusUnauthorized() *RemoteStatusUnauthorized { + + return &RemoteStatusUnauthorized{} +} + +// WriteResponse to the client +func (o *RemoteStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// RemoteStatusInternalServerErrorCode is the HTTP code returned for type RemoteStatusInternalServerError +const RemoteStatusInternalServerErrorCode int = 500 + +/* +RemoteStatusInternalServerError internal server error + +swagger:response remoteStatusInternalServerError +*/ +type RemoteStatusInternalServerError struct { +} + +// NewRemoteStatusInternalServerError creates RemoteStatusInternalServerError with default headers values +func NewRemoteStatusInternalServerError() *RemoteStatusInternalServerError { + + return &RemoteStatusInternalServerError{} +} + +// WriteResponse to the client +func (o *RemoteStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} + +// RemoteStatusBadGatewayCode is the HTTP code returned for type RemoteStatusBadGateway +const RemoteStatusBadGatewayCode int = 502 + +/* +RemoteStatusBadGateway bad gateway; agent not reachable + +swagger:response remoteStatusBadGateway +*/ +type RemoteStatusBadGateway struct { +} + +// NewRemoteStatusBadGateway creates RemoteStatusBadGateway with default headers values +func NewRemoteStatusBadGateway() *RemoteStatusBadGateway { + + return &RemoteStatusBadGateway{} +} + +// WriteResponse to the client +func (o *RemoteStatusBadGateway) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(502) +} diff --git a/rest_server_zrok/operations/agent/remote_status_urlbuilder.go b/rest_server_zrok/operations/agent/remote_status_urlbuilder.go new file mode 100644 index 00000000..206acba0 --- /dev/null +++ b/rest_server_zrok/operations/agent/remote_status_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// RemoteStatusURL generates an URL for the remote status operation +type RemoteStatusURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RemoteStatusURL) WithBasePath(bp string) *RemoteStatusURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RemoteStatusURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *RemoteStatusURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/agent/status" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/api/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *RemoteStatusURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *RemoteStatusURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *RemoteStatusURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on RemoteStatusURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on RemoteStatusURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *RemoteStatusURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/rest_server_zrok/operations/agent/unenroll_responses.go b/rest_server_zrok/operations/agent/unenroll_responses.go index ebe96dd9..87cc5376 100644 --- a/rest_server_zrok/operations/agent/unenroll_responses.go +++ b/rest_server_zrok/operations/agent/unenroll_responses.go @@ -90,7 +90,7 @@ func (o *UnenrollUnauthorized) WriteResponse(rw http.ResponseWriter, producer ru const UnenrollInternalServerErrorCode int = 500 /* -UnenrollInternalServerError unenroll internal server error +UnenrollInternalServerError internal server error swagger:response unenrollInternalServerError */ diff --git a/rest_server_zrok/operations/zrok_api.go b/rest_server_zrok/operations/zrok_api.go index e508ec2f..4c015ed2 100644 --- a/rest_server_zrok/operations/zrok_api.go +++ b/rest_server_zrok/operations/zrok_api.go @@ -161,6 +161,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI { AgentRemoteShareHandler: agent.RemoteShareHandlerFunc(func(params agent.RemoteShareParams, principal *rest_model_zrok.Principal) middleware.Responder { return middleware.NotImplemented("operation agent.RemoteShare has not yet been implemented") }), + AgentRemoteStatusHandler: agent.RemoteStatusHandlerFunc(func(params agent.RemoteStatusParams, principal *rest_model_zrok.Principal) middleware.Responder { + return middleware.NotImplemented("operation agent.RemoteStatus has not yet been implemented") + }), AgentRemoteUnshareHandler: agent.RemoteUnshareHandlerFunc(func(params agent.RemoteUnshareParams, principal *rest_model_zrok.Principal) middleware.Responder { return middleware.NotImplemented("operation agent.RemoteUnshare has not yet been implemented") }), @@ -327,6 +330,8 @@ type ZrokAPI struct { AccountRegisterHandler account.RegisterHandler // AgentRemoteShareHandler sets the operation handler for the remote share operation AgentRemoteShareHandler agent.RemoteShareHandler + // AgentRemoteStatusHandler sets the operation handler for the remote status operation + AgentRemoteStatusHandler agent.RemoteStatusHandler // AgentRemoteUnshareHandler sets the operation handler for the remote unshare operation AgentRemoteUnshareHandler agent.RemoteUnshareHandler // AdminRemoveOrganizationMemberHandler sets the operation handler for the remove organization member operation @@ -547,6 +552,9 @@ func (o *ZrokAPI) Validate() error { if o.AgentRemoteShareHandler == nil { unregistered = append(unregistered, "agent.RemoteShareHandler") } + if o.AgentRemoteStatusHandler == nil { + unregistered = append(unregistered, "agent.RemoteStatusHandler") + } if o.AgentRemoteUnshareHandler == nil { unregistered = append(unregistered, "agent.RemoteUnshareHandler") } @@ -839,6 +847,10 @@ func (o *ZrokAPI) initHandlerCache() { if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) } + o.handlers["POST"]["/agent/status"] = agent.NewRemoteStatus(o.context, o.AgentRemoteStatusHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } o.handlers["POST"]["/agent/unshare"] = agent.NewRemoteUnshare(o.context, o.AgentRemoteUnshareHandler) if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) diff --git a/sdk/nodejs/sdk/src/api/.openapi-generator/FILES b/sdk/nodejs/sdk/src/api/.openapi-generator/FILES index f1616dca..383bbb26 100644 --- a/sdk/nodejs/sdk/src/api/.openapi-generator/FILES +++ b/sdk/nodejs/sdk/src/api/.openapi-generator/FILES @@ -49,6 +49,9 @@ models/RegenerateAccountTokenRequest.ts models/RegisterRequest.ts models/RemoteShare200Response.ts models/RemoteShareRequest.ts +models/RemoteStatus200Response.ts +models/RemoteStatus200ResponseAccessesInner.ts +models/RemoteStatus200ResponseSharesInner.ts models/RemoteUnshareRequest.ts models/RemoveOrganizationMemberRequest.ts models/ResetPasswordRequest.ts diff --git a/sdk/nodejs/sdk/src/api/apis/AgentApi.ts b/sdk/nodejs/sdk/src/api/apis/AgentApi.ts index 0730970d..7ccb6f92 100644 --- a/sdk/nodejs/sdk/src/api/apis/AgentApi.ts +++ b/sdk/nodejs/sdk/src/api/apis/AgentApi.ts @@ -20,6 +20,7 @@ import type { Ping200Response, RemoteShare200Response, RemoteShareRequest, + RemoteStatus200Response, RemoteUnshareRequest, } from '../models/index'; import { @@ -33,6 +34,8 @@ import { RemoteShare200ResponseToJSON, RemoteShareRequestFromJSON, RemoteShareRequestToJSON, + RemoteStatus200ResponseFromJSON, + RemoteStatus200ResponseToJSON, RemoteUnshareRequestFromJSON, RemoteUnshareRequestToJSON, } from '../models/index'; @@ -49,6 +52,10 @@ export interface RemoteShareOperationRequest { body?: RemoteShareRequest; } +export interface RemoteStatusRequest { + body?: EnrollRequest; +} + export interface RemoteUnshareOperationRequest { body?: RemoteUnshareRequest; } @@ -155,6 +162,37 @@ export class AgentApi extends runtime.BaseAPI { return await response.value(); } + /** + */ + async remoteStatusRaw(requestParameters: RemoteStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/zrok.v1+json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication + } + + const response = await this.request({ + path: `/agent/status`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: EnrollRequestToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RemoteStatus200ResponseFromJSON(jsonValue)); + } + + /** + */ + async remoteStatus(requestParameters: RemoteStatusRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.remoteStatusRaw(requestParameters, initOverrides); + return await response.value(); + } + /** */ async remoteUnshareRaw(requestParameters: RemoteUnshareOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { diff --git a/sdk/nodejs/sdk/src/api/models/RemoteStatus200Response.ts b/sdk/nodejs/sdk/src/api/models/RemoteStatus200Response.ts new file mode 100644 index 00000000..e8da81ea --- /dev/null +++ b/sdk/nodejs/sdk/src/api/models/RemoteStatus200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { RemoteStatus200ResponseSharesInner } from './RemoteStatus200ResponseSharesInner'; +import { + RemoteStatus200ResponseSharesInnerFromJSON, + RemoteStatus200ResponseSharesInnerFromJSONTyped, + RemoteStatus200ResponseSharesInnerToJSON, + RemoteStatus200ResponseSharesInnerToJSONTyped, +} from './RemoteStatus200ResponseSharesInner'; +import type { RemoteStatus200ResponseAccessesInner } from './RemoteStatus200ResponseAccessesInner'; +import { + RemoteStatus200ResponseAccessesInnerFromJSON, + RemoteStatus200ResponseAccessesInnerFromJSONTyped, + RemoteStatus200ResponseAccessesInnerToJSON, + RemoteStatus200ResponseAccessesInnerToJSONTyped, +} from './RemoteStatus200ResponseAccessesInner'; + +/** + * + * @export + * @interface RemoteStatus200Response + */ +export interface RemoteStatus200Response { + /** + * + * @type {Array} + * @memberof RemoteStatus200Response + */ + shares?: Array; + /** + * + * @type {Array} + * @memberof RemoteStatus200Response + */ + accesses?: Array; +} + +/** + * Check if a given object implements the RemoteStatus200Response interface. + */ +export function instanceOfRemoteStatus200Response(value: object): value is RemoteStatus200Response { + return true; +} + +export function RemoteStatus200ResponseFromJSON(json: any): RemoteStatus200Response { + return RemoteStatus200ResponseFromJSONTyped(json, false); +} + +export function RemoteStatus200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RemoteStatus200Response { + if (json == null) { + return json; + } + return { + + 'shares': json['shares'] == null ? undefined : ((json['shares'] as Array).map(RemoteStatus200ResponseSharesInnerFromJSON)), + 'accesses': json['accesses'] == null ? undefined : ((json['accesses'] as Array).map(RemoteStatus200ResponseAccessesInnerFromJSON)), + }; +} + +export function RemoteStatus200ResponseToJSON(json: any): RemoteStatus200Response { + return RemoteStatus200ResponseToJSONTyped(json, false); +} + +export function RemoteStatus200ResponseToJSONTyped(value?: RemoteStatus200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'shares': value['shares'] == null ? undefined : ((value['shares'] as Array).map(RemoteStatus200ResponseSharesInnerToJSON)), + 'accesses': value['accesses'] == null ? undefined : ((value['accesses'] as Array).map(RemoteStatus200ResponseAccessesInnerToJSON)), + }; +} + diff --git a/sdk/nodejs/sdk/src/api/models/RemoteStatus200ResponseAccessesInner.ts b/sdk/nodejs/sdk/src/api/models/RemoteStatus200ResponseAccessesInner.ts new file mode 100644 index 00000000..a0e217e1 --- /dev/null +++ b/sdk/nodejs/sdk/src/api/models/RemoteStatus200ResponseAccessesInner.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface RemoteStatus200ResponseAccessesInner + */ +export interface RemoteStatus200ResponseAccessesInner { + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseAccessesInner + */ + frontendToken?: string; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseAccessesInner + */ + token?: string; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseAccessesInner + */ + bindAddress?: string; + /** + * + * @type {Array} + * @memberof RemoteStatus200ResponseAccessesInner + */ + responseHeaders?: Array; +} + +/** + * Check if a given object implements the RemoteStatus200ResponseAccessesInner interface. + */ +export function instanceOfRemoteStatus200ResponseAccessesInner(value: object): value is RemoteStatus200ResponseAccessesInner { + return true; +} + +export function RemoteStatus200ResponseAccessesInnerFromJSON(json: any): RemoteStatus200ResponseAccessesInner { + return RemoteStatus200ResponseAccessesInnerFromJSONTyped(json, false); +} + +export function RemoteStatus200ResponseAccessesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RemoteStatus200ResponseAccessesInner { + if (json == null) { + return json; + } + return { + + 'frontendToken': json['frontendToken'] == null ? undefined : json['frontendToken'], + 'token': json['token'] == null ? undefined : json['token'], + 'bindAddress': json['bindAddress'] == null ? undefined : json['bindAddress'], + 'responseHeaders': json['responseHeaders'] == null ? undefined : json['responseHeaders'], + }; +} + +export function RemoteStatus200ResponseAccessesInnerToJSON(json: any): RemoteStatus200ResponseAccessesInner { + return RemoteStatus200ResponseAccessesInnerToJSONTyped(json, false); +} + +export function RemoteStatus200ResponseAccessesInnerToJSONTyped(value?: RemoteStatus200ResponseAccessesInner | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'frontendToken': value['frontendToken'], + 'token': value['token'], + 'bindAddress': value['bindAddress'], + 'responseHeaders': value['responseHeaders'], + }; +} + diff --git a/sdk/nodejs/sdk/src/api/models/RemoteStatus200ResponseSharesInner.ts b/sdk/nodejs/sdk/src/api/models/RemoteStatus200ResponseSharesInner.ts new file mode 100644 index 00000000..c34aa0b8 --- /dev/null +++ b/sdk/nodejs/sdk/src/api/models/RemoteStatus200ResponseSharesInner.ts @@ -0,0 +1,121 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface RemoteStatus200ResponseSharesInner + */ +export interface RemoteStatus200ResponseSharesInner { + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseSharesInner + */ + token?: string; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseSharesInner + */ + shareMode?: string; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseSharesInner + */ + backendMode?: string; + /** + * + * @type {boolean} + * @memberof RemoteStatus200ResponseSharesInner + */ + reserved?: boolean; + /** + * + * @type {Array} + * @memberof RemoteStatus200ResponseSharesInner + */ + frontendEndpoints?: Array; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseSharesInner + */ + backendEndpoint?: string; + /** + * + * @type {boolean} + * @memberof RemoteStatus200ResponseSharesInner + */ + open?: boolean; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseSharesInner + */ + status?: string; +} + +/** + * Check if a given object implements the RemoteStatus200ResponseSharesInner interface. + */ +export function instanceOfRemoteStatus200ResponseSharesInner(value: object): value is RemoteStatus200ResponseSharesInner { + return true; +} + +export function RemoteStatus200ResponseSharesInnerFromJSON(json: any): RemoteStatus200ResponseSharesInner { + return RemoteStatus200ResponseSharesInnerFromJSONTyped(json, false); +} + +export function RemoteStatus200ResponseSharesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RemoteStatus200ResponseSharesInner { + if (json == null) { + return json; + } + return { + + 'token': json['token'] == null ? undefined : json['token'], + 'shareMode': json['shareMode'] == null ? undefined : json['shareMode'], + 'backendMode': json['backendMode'] == null ? undefined : json['backendMode'], + 'reserved': json['reserved'] == null ? undefined : json['reserved'], + 'frontendEndpoints': json['frontendEndpoints'] == null ? undefined : json['frontendEndpoints'], + 'backendEndpoint': json['backendEndpoint'] == null ? undefined : json['backendEndpoint'], + 'open': json['open'] == null ? undefined : json['open'], + 'status': json['status'] == null ? undefined : json['status'], + }; +} + +export function RemoteStatus200ResponseSharesInnerToJSON(json: any): RemoteStatus200ResponseSharesInner { + return RemoteStatus200ResponseSharesInnerToJSONTyped(json, false); +} + +export function RemoteStatus200ResponseSharesInnerToJSONTyped(value?: RemoteStatus200ResponseSharesInner | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'token': value['token'], + 'shareMode': value['shareMode'], + 'backendMode': value['backendMode'], + 'reserved': value['reserved'], + 'frontendEndpoints': value['frontendEndpoints'], + 'backendEndpoint': value['backendEndpoint'], + 'open': value['open'], + 'status': value['status'], + }; +} + diff --git a/sdk/nodejs/sdk/src/api/models/index.ts b/sdk/nodejs/sdk/src/api/models/index.ts index fa868bdd..f380a124 100644 --- a/sdk/nodejs/sdk/src/api/models/index.ts +++ b/sdk/nodejs/sdk/src/api/models/index.ts @@ -42,6 +42,9 @@ export * from './RegenerateAccountTokenRequest'; export * from './RegisterRequest'; export * from './RemoteShare200Response'; export * from './RemoteShareRequest'; +export * from './RemoteStatus200Response'; +export * from './RemoteStatus200ResponseAccessesInner'; +export * from './RemoteStatus200ResponseSharesInner'; export * from './RemoteUnshareRequest'; export * from './RemoveOrganizationMemberRequest'; export * from './ResetPasswordRequest'; diff --git a/sdk/python/src/.openapi-generator/FILES b/sdk/python/src/.openapi-generator/FILES index 82a00667..289074a6 100644 --- a/sdk/python/src/.openapi-generator/FILES +++ b/sdk/python/src/.openapi-generator/FILES @@ -47,6 +47,9 @@ docs/RegenerateAccountTokenRequest.md docs/RegisterRequest.md docs/RemoteShare200Response.md docs/RemoteShareRequest.md +docs/RemoteStatus200Response.md +docs/RemoteStatus200ResponseAccessesInner.md +docs/RemoteStatus200ResponseSharesInner.md docs/RemoteUnshareRequest.md docs/RemoveOrganizationMemberRequest.md docs/ResetPasswordRequest.md @@ -113,6 +116,9 @@ test/test_regenerate_account_token_request.py test/test_register_request.py test/test_remote_share200_response.py test/test_remote_share_request.py +test/test_remote_status200_response.py +test/test_remote_status200_response_accesses_inner.py +test/test_remote_status200_response_shares_inner.py test/test_remote_unshare_request.py test/test_remove_organization_member_request.py test/test_reset_password_request.py @@ -184,6 +190,9 @@ zrok_api/models/regenerate_account_token_request.py zrok_api/models/register_request.py zrok_api/models/remote_share200_response.py zrok_api/models/remote_share_request.py +zrok_api/models/remote_status200_response.py +zrok_api/models/remote_status200_response_accesses_inner.py +zrok_api/models/remote_status200_response_shares_inner.py zrok_api/models/remote_unshare_request.py zrok_api/models/remove_organization_member_request.py zrok_api/models/reset_password_request.py diff --git a/sdk/python/src/README.md b/sdk/python/src/README.md index 3de775a8..a7c66b95 100644 --- a/sdk/python/src/README.md +++ b/sdk/python/src/README.md @@ -117,6 +117,7 @@ Class | Method | HTTP request | Description *AgentApi* | [**enroll**](docs/AgentApi.md#enroll) | **POST** /agent/enroll | *AgentApi* | [**ping**](docs/AgentApi.md#ping) | **POST** /agent/ping | *AgentApi* | [**remote_share**](docs/AgentApi.md#remote_share) | **POST** /agent/share | +*AgentApi* | [**remote_status**](docs/AgentApi.md#remote_status) | **POST** /agent/status | *AgentApi* | [**remote_unshare**](docs/AgentApi.md#remote_unshare) | **POST** /agent/unshare | *AgentApi* | [**unenroll**](docs/AgentApi.md#unenroll) | **POST** /agent/unenroll | *EnvironmentApi* | [**disable**](docs/EnvironmentApi.md#disable) | **POST** /disable | @@ -189,6 +190,9 @@ Class | Method | HTTP request | Description - [RegisterRequest](docs/RegisterRequest.md) - [RemoteShare200Response](docs/RemoteShare200Response.md) - [RemoteShareRequest](docs/RemoteShareRequest.md) + - [RemoteStatus200Response](docs/RemoteStatus200Response.md) + - [RemoteStatus200ResponseAccessesInner](docs/RemoteStatus200ResponseAccessesInner.md) + - [RemoteStatus200ResponseSharesInner](docs/RemoteStatus200ResponseSharesInner.md) - [RemoteUnshareRequest](docs/RemoteUnshareRequest.md) - [RemoveOrganizationMemberRequest](docs/RemoveOrganizationMemberRequest.md) - [ResetPasswordRequest](docs/ResetPasswordRequest.md) diff --git a/sdk/python/src/docs/AgentApi.md b/sdk/python/src/docs/AgentApi.md index b4bfbb43..5a8abe5c 100644 --- a/sdk/python/src/docs/AgentApi.md +++ b/sdk/python/src/docs/AgentApi.md @@ -7,6 +7,7 @@ Method | HTTP request | Description [**enroll**](AgentApi.md#enroll) | **POST** /agent/enroll | [**ping**](AgentApi.md#ping) | **POST** /agent/ping | [**remote_share**](AgentApi.md#remote_share) | **POST** /agent/share | +[**remote_status**](AgentApi.md#remote_status) | **POST** /agent/status | [**remote_unshare**](AgentApi.md#remote_unshare) | **POST** /agent/unshare | [**unenroll**](AgentApi.md#unenroll) | **POST** /agent/unenroll | @@ -245,6 +246,84 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **remote_status** +> RemoteStatus200Response remote_status(body=body) + +### Example + +* Api Key Authentication (key): + +```python +import zrok_api +from zrok_api.models.enroll_request import EnrollRequest +from zrok_api.models.remote_status200_response import RemoteStatus200Response +from zrok_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = zrok_api.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: key +configuration.api_key['key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['key'] = 'Bearer' + +# Enter a context with an instance of the API client +with zrok_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = zrok_api.AgentApi(api_client) + body = zrok_api.EnrollRequest() # EnrollRequest | (optional) + + try: + api_response = api_instance.remote_status(body=body) + print("The response of AgentApi->remote_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentApi->remote_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**EnrollRequest**](EnrollRequest.md)| | [optional] + +### Return type + +[**RemoteStatus200Response**](RemoteStatus200Response.md) + +### Authorization + +[key](../README.md#key) + +### HTTP request headers + + - **Content-Type**: application/zrok.v1+json + - **Accept**: application/zrok.v1+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**500** | internal server error | - | +**502** | bad gateway; agent not reachable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **remote_unshare** > remote_unshare(body=body) @@ -391,6 +470,7 @@ void (empty response body) **200** | ok | - | **400** | bad request; not enrolled | - | **401** | unauthorized | - | +**500** | internal server error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/sdk/python/src/docs/RemoteStatus200Response.md b/sdk/python/src/docs/RemoteStatus200Response.md new file mode 100644 index 00000000..10f769f2 --- /dev/null +++ b/sdk/python/src/docs/RemoteStatus200Response.md @@ -0,0 +1,30 @@ +# RemoteStatus200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shares** | [**List[RemoteStatus200ResponseSharesInner]**](RemoteStatus200ResponseSharesInner.md) | | [optional] +**accesses** | [**List[RemoteStatus200ResponseAccessesInner]**](RemoteStatus200ResponseAccessesInner.md) | | [optional] + +## Example + +```python +from zrok_api.models.remote_status200_response import RemoteStatus200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of RemoteStatus200Response from a JSON string +remote_status200_response_instance = RemoteStatus200Response.from_json(json) +# print the JSON string representation of the object +print(RemoteStatus200Response.to_json()) + +# convert the object into a dict +remote_status200_response_dict = remote_status200_response_instance.to_dict() +# create an instance of RemoteStatus200Response from a dict +remote_status200_response_from_dict = RemoteStatus200Response.from_dict(remote_status200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/python/src/docs/RemoteStatus200ResponseAccessesInner.md b/sdk/python/src/docs/RemoteStatus200ResponseAccessesInner.md new file mode 100644 index 00000000..e190d043 --- /dev/null +++ b/sdk/python/src/docs/RemoteStatus200ResponseAccessesInner.md @@ -0,0 +1,32 @@ +# RemoteStatus200ResponseAccessesInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**frontend_token** | **str** | | [optional] +**token** | **str** | | [optional] +**bind_address** | **str** | | [optional] +**response_headers** | **List[str]** | | [optional] + +## Example + +```python +from zrok_api.models.remote_status200_response_accesses_inner import RemoteStatus200ResponseAccessesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of RemoteStatus200ResponseAccessesInner from a JSON string +remote_status200_response_accesses_inner_instance = RemoteStatus200ResponseAccessesInner.from_json(json) +# print the JSON string representation of the object +print(RemoteStatus200ResponseAccessesInner.to_json()) + +# convert the object into a dict +remote_status200_response_accesses_inner_dict = remote_status200_response_accesses_inner_instance.to_dict() +# create an instance of RemoteStatus200ResponseAccessesInner from a dict +remote_status200_response_accesses_inner_from_dict = RemoteStatus200ResponseAccessesInner.from_dict(remote_status200_response_accesses_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/python/src/docs/RemoteStatus200ResponseSharesInner.md b/sdk/python/src/docs/RemoteStatus200ResponseSharesInner.md new file mode 100644 index 00000000..766ef9af --- /dev/null +++ b/sdk/python/src/docs/RemoteStatus200ResponseSharesInner.md @@ -0,0 +1,36 @@ +# RemoteStatus200ResponseSharesInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **str** | | [optional] +**share_mode** | **str** | | [optional] +**backend_mode** | **str** | | [optional] +**reserved** | **bool** | | [optional] +**frontend_endpoints** | **List[str]** | | [optional] +**backend_endpoint** | **str** | | [optional] +**open** | **bool** | | [optional] +**status** | **str** | | [optional] + +## Example + +```python +from zrok_api.models.remote_status200_response_shares_inner import RemoteStatus200ResponseSharesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of RemoteStatus200ResponseSharesInner from a JSON string +remote_status200_response_shares_inner_instance = RemoteStatus200ResponseSharesInner.from_json(json) +# print the JSON string representation of the object +print(RemoteStatus200ResponseSharesInner.to_json()) + +# convert the object into a dict +remote_status200_response_shares_inner_dict = remote_status200_response_shares_inner_instance.to_dict() +# create an instance of RemoteStatus200ResponseSharesInner from a dict +remote_status200_response_shares_inner_from_dict = RemoteStatus200ResponseSharesInner.from_dict(remote_status200_response_shares_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/python/src/test/test_agent_api.py b/sdk/python/src/test/test_agent_api.py index 0a61b21d..32e0fec3 100644 --- a/sdk/python/src/test/test_agent_api.py +++ b/sdk/python/src/test/test_agent_api.py @@ -44,6 +44,12 @@ class TestAgentApi(unittest.TestCase): """ pass + def test_remote_status(self) -> None: + """Test case for remote_status + + """ + pass + def test_remote_unshare(self) -> None: """Test case for remote_unshare diff --git a/sdk/python/src/test/test_remote_status200_response.py b/sdk/python/src/test/test_remote_status200_response.py new file mode 100644 index 00000000..68e85714 --- /dev/null +++ b/sdk/python/src/test/test_remote_status200_response.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from zrok_api.models.remote_status200_response import RemoteStatus200Response + +class TestRemoteStatus200Response(unittest.TestCase): + """RemoteStatus200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RemoteStatus200Response: + """Test RemoteStatus200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RemoteStatus200Response` + """ + model = RemoteStatus200Response() + if include_optional: + return RemoteStatus200Response( + shares = [ + zrok_api.models.remote_status_200_response_shares_inner.remoteStatus_200_response_shares_inner( + token = '', + share_mode = '', + backend_mode = '', + reserved = True, + frontend_endpoints = [ + '' + ], + backend_endpoint = '', + open = True, + status = '', ) + ], + accesses = [ + zrok_api.models.remote_status_200_response_accesses_inner.remoteStatus_200_response_accesses_inner( + frontend_token = '', + token = '', + bind_address = '', + response_headers = [ + '' + ], ) + ] + ) + else: + return RemoteStatus200Response( + ) + """ + + def testRemoteStatus200Response(self): + """Test RemoteStatus200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/sdk/python/src/test/test_remote_status200_response_accesses_inner.py b/sdk/python/src/test/test_remote_status200_response_accesses_inner.py new file mode 100644 index 00000000..64e51f17 --- /dev/null +++ b/sdk/python/src/test/test_remote_status200_response_accesses_inner.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from zrok_api.models.remote_status200_response_accesses_inner import RemoteStatus200ResponseAccessesInner + +class TestRemoteStatus200ResponseAccessesInner(unittest.TestCase): + """RemoteStatus200ResponseAccessesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RemoteStatus200ResponseAccessesInner: + """Test RemoteStatus200ResponseAccessesInner + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RemoteStatus200ResponseAccessesInner` + """ + model = RemoteStatus200ResponseAccessesInner() + if include_optional: + return RemoteStatus200ResponseAccessesInner( + frontend_token = '', + token = '', + bind_address = '', + response_headers = [ + '' + ] + ) + else: + return RemoteStatus200ResponseAccessesInner( + ) + """ + + def testRemoteStatus200ResponseAccessesInner(self): + """Test RemoteStatus200ResponseAccessesInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/sdk/python/src/test/test_remote_status200_response_shares_inner.py b/sdk/python/src/test/test_remote_status200_response_shares_inner.py new file mode 100644 index 00000000..28392eab --- /dev/null +++ b/sdk/python/src/test/test_remote_status200_response_shares_inner.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from zrok_api.models.remote_status200_response_shares_inner import RemoteStatus200ResponseSharesInner + +class TestRemoteStatus200ResponseSharesInner(unittest.TestCase): + """RemoteStatus200ResponseSharesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RemoteStatus200ResponseSharesInner: + """Test RemoteStatus200ResponseSharesInner + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RemoteStatus200ResponseSharesInner` + """ + model = RemoteStatus200ResponseSharesInner() + if include_optional: + return RemoteStatus200ResponseSharesInner( + token = '', + share_mode = '', + backend_mode = '', + reserved = True, + frontend_endpoints = [ + '' + ], + backend_endpoint = '', + open = True, + status = '' + ) + else: + return RemoteStatus200ResponseSharesInner( + ) + """ + + def testRemoteStatus200ResponseSharesInner(self): + """Test RemoteStatus200ResponseSharesInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/sdk/python/src/zrok_api/__init__.py b/sdk/python/src/zrok_api/__init__.py index f2c5f774..6150272a 100644 --- a/sdk/python/src/zrok_api/__init__.py +++ b/sdk/python/src/zrok_api/__init__.py @@ -78,6 +78,9 @@ from zrok_api.models.regenerate_account_token_request import RegenerateAccountTo from zrok_api.models.register_request import RegisterRequest from zrok_api.models.remote_share200_response import RemoteShare200Response from zrok_api.models.remote_share_request import RemoteShareRequest +from zrok_api.models.remote_status200_response import RemoteStatus200Response +from zrok_api.models.remote_status200_response_accesses_inner import RemoteStatus200ResponseAccessesInner +from zrok_api.models.remote_status200_response_shares_inner import RemoteStatus200ResponseSharesInner from zrok_api.models.remote_unshare_request import RemoteUnshareRequest from zrok_api.models.remove_organization_member_request import RemoveOrganizationMemberRequest from zrok_api.models.reset_password_request import ResetPasswordRequest diff --git a/sdk/python/src/zrok_api/api/agent_api.py b/sdk/python/src/zrok_api/api/agent_api.py index 2ad03a82..72bd32c3 100644 --- a/sdk/python/src/zrok_api/api/agent_api.py +++ b/sdk/python/src/zrok_api/api/agent_api.py @@ -22,6 +22,7 @@ from zrok_api.models.enroll_request import EnrollRequest from zrok_api.models.ping200_response import Ping200Response from zrok_api.models.remote_share200_response import RemoteShare200Response from zrok_api.models.remote_share_request import RemoteShareRequest +from zrok_api.models.remote_status200_response import RemoteStatus200Response from zrok_api.models.remote_unshare_request import RemoteUnshareRequest from zrok_api.api_client import ApiClient, RequestSerialized @@ -882,6 +883,286 @@ class AgentApi: + @validate_call + def remote_status( + self, + body: Optional[EnrollRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RemoteStatus200Response: + """remote_status + + + :param body: + :type body: EnrollRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remote_status_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RemoteStatus200Response", + '401': None, + '500': None, + '502': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remote_status_with_http_info( + self, + body: Optional[EnrollRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RemoteStatus200Response]: + """remote_status + + + :param body: + :type body: EnrollRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remote_status_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RemoteStatus200Response", + '401': None, + '500': None, + '502': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def remote_status_without_preload_content( + self, + body: Optional[EnrollRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """remote_status + + + :param body: + :type body: EnrollRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remote_status_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RemoteStatus200Response", + '401': None, + '500': None, + '502': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remote_status_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/zrok.v1+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/zrok.v1+json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/agent/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def remote_unshare( self, @@ -1211,6 +1492,7 @@ class AgentApi: '200': None, '400': None, '401': None, + '500': None, } response_data = self.api_client.call_api( *_param, @@ -1279,6 +1561,7 @@ class AgentApi: '200': None, '400': None, '401': None, + '500': None, } response_data = self.api_client.call_api( *_param, @@ -1347,6 +1630,7 @@ class AgentApi: '200': None, '400': None, '401': None, + '500': None, } response_data = self.api_client.call_api( *_param, diff --git a/sdk/python/src/zrok_api/models/__init__.py b/sdk/python/src/zrok_api/models/__init__.py index b0152088..6a8005ad 100644 --- a/sdk/python/src/zrok_api/models/__init__.py +++ b/sdk/python/src/zrok_api/models/__init__.py @@ -56,6 +56,9 @@ from zrok_api.models.regenerate_account_token_request import RegenerateAccountTo from zrok_api.models.register_request import RegisterRequest from zrok_api.models.remote_share200_response import RemoteShare200Response from zrok_api.models.remote_share_request import RemoteShareRequest +from zrok_api.models.remote_status200_response import RemoteStatus200Response +from zrok_api.models.remote_status200_response_accesses_inner import RemoteStatus200ResponseAccessesInner +from zrok_api.models.remote_status200_response_shares_inner import RemoteStatus200ResponseSharesInner from zrok_api.models.remote_unshare_request import RemoteUnshareRequest from zrok_api.models.remove_organization_member_request import RemoveOrganizationMemberRequest from zrok_api.models.reset_password_request import ResetPasswordRequest diff --git a/sdk/python/src/zrok_api/models/remote_status200_response.py b/sdk/python/src/zrok_api/models/remote_status200_response.py new file mode 100644 index 00000000..e2d6ae1d --- /dev/null +++ b/sdk/python/src/zrok_api/models/remote_status200_response.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from zrok_api.models.remote_status200_response_accesses_inner import RemoteStatus200ResponseAccessesInner +from zrok_api.models.remote_status200_response_shares_inner import RemoteStatus200ResponseSharesInner +from typing import Optional, Set +from typing_extensions import Self + +class RemoteStatus200Response(BaseModel): + """ + RemoteStatus200Response + """ # noqa: E501 + shares: Optional[List[RemoteStatus200ResponseSharesInner]] = None + accesses: Optional[List[RemoteStatus200ResponseAccessesInner]] = None + __properties: ClassVar[List[str]] = ["shares", "accesses"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RemoteStatus200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in shares (list) + _items = [] + if self.shares: + for _item_shares in self.shares: + if _item_shares: + _items.append(_item_shares.to_dict()) + _dict['shares'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in accesses (list) + _items = [] + if self.accesses: + for _item_accesses in self.accesses: + if _item_accesses: + _items.append(_item_accesses.to_dict()) + _dict['accesses'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RemoteStatus200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "shares": [RemoteStatus200ResponseSharesInner.from_dict(_item) for _item in obj["shares"]] if obj.get("shares") is not None else None, + "accesses": [RemoteStatus200ResponseAccessesInner.from_dict(_item) for _item in obj["accesses"]] if obj.get("accesses") is not None else None + }) + return _obj + + diff --git a/sdk/python/src/zrok_api/models/remote_status200_response_accesses_inner.py b/sdk/python/src/zrok_api/models/remote_status200_response_accesses_inner.py new file mode 100644 index 00000000..0f3f54da --- /dev/null +++ b/sdk/python/src/zrok_api/models/remote_status200_response_accesses_inner.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RemoteStatus200ResponseAccessesInner(BaseModel): + """ + RemoteStatus200ResponseAccessesInner + """ # noqa: E501 + frontend_token: Optional[StrictStr] = Field(default=None, alias="frontendToken") + token: Optional[StrictStr] = None + bind_address: Optional[StrictStr] = Field(default=None, alias="bindAddress") + response_headers: Optional[List[StrictStr]] = Field(default=None, alias="responseHeaders") + __properties: ClassVar[List[str]] = ["frontendToken", "token", "bindAddress", "responseHeaders"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RemoteStatus200ResponseAccessesInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RemoteStatus200ResponseAccessesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "frontendToken": obj.get("frontendToken"), + "token": obj.get("token"), + "bindAddress": obj.get("bindAddress"), + "responseHeaders": obj.get("responseHeaders") + }) + return _obj + + diff --git a/sdk/python/src/zrok_api/models/remote_status200_response_shares_inner.py b/sdk/python/src/zrok_api/models/remote_status200_response_shares_inner.py new file mode 100644 index 00000000..a197b7e5 --- /dev/null +++ b/sdk/python/src/zrok_api/models/remote_status200_response_shares_inner.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RemoteStatus200ResponseSharesInner(BaseModel): + """ + RemoteStatus200ResponseSharesInner + """ # noqa: E501 + token: Optional[StrictStr] = None + share_mode: Optional[StrictStr] = Field(default=None, alias="shareMode") + backend_mode: Optional[StrictStr] = Field(default=None, alias="backendMode") + reserved: Optional[StrictBool] = None + frontend_endpoints: Optional[List[StrictStr]] = Field(default=None, alias="frontendEndpoints") + backend_endpoint: Optional[StrictStr] = Field(default=None, alias="backendEndpoint") + open: Optional[StrictBool] = None + status: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["token", "shareMode", "backendMode", "reserved", "frontendEndpoints", "backendEndpoint", "open", "status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RemoteStatus200ResponseSharesInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RemoteStatus200ResponseSharesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "token": obj.get("token"), + "shareMode": obj.get("shareMode"), + "backendMode": obj.get("backendMode"), + "reserved": obj.get("reserved"), + "frontendEndpoints": obj.get("frontendEndpoints"), + "backendEndpoint": obj.get("backendEndpoint"), + "open": obj.get("open"), + "status": obj.get("status") + }) + return _obj + + diff --git a/specs/zrok.yml b/specs/zrok.yml index 492f916c..b156351f 100644 --- a/specs/zrok.yml +++ b/specs/zrok.yml @@ -738,6 +738,70 @@ paths: 502: description: bad gateway; agent not reachable + /agent/status: + post: + tags: + - agent + security: + - key: [] + operationId: remoteStatus + parameters: + - name: body + in: body + schema: + properties: + envZId: + type: string + responses: + 200: + description: ok + schema: + properties: + shares: + type: array + items: + type: object + properties: + token: + type: string + shareMode: + type: string + backendMode: + type: string + reserved: + type: boolean + frontendEndpoints: + type: array + items: + type: string + backendEndpoint: + type: string + open: + type: boolean + status: + type: string + accesses: + type: array + items: + type: object + properties: + frontendToken: + type: string + token: + type: string + bindAddress: + type: string + responseHeaders: + type: array + items: + type: string + 401: + description: unauthorized + 500: + description: internal server error + 502: + description: bad gateway; agent not reachable + /agent/unenroll: post: tags: @@ -760,6 +824,7 @@ paths: 401: description: unauthorized 500: + description: internal server error /agent/unshare: post: diff --git a/ui/src/api/.openapi-generator/FILES b/ui/src/api/.openapi-generator/FILES index f1616dca..383bbb26 100644 --- a/ui/src/api/.openapi-generator/FILES +++ b/ui/src/api/.openapi-generator/FILES @@ -49,6 +49,9 @@ models/RegenerateAccountTokenRequest.ts models/RegisterRequest.ts models/RemoteShare200Response.ts models/RemoteShareRequest.ts +models/RemoteStatus200Response.ts +models/RemoteStatus200ResponseAccessesInner.ts +models/RemoteStatus200ResponseSharesInner.ts models/RemoteUnshareRequest.ts models/RemoveOrganizationMemberRequest.ts models/ResetPasswordRequest.ts diff --git a/ui/src/api/apis/AgentApi.ts b/ui/src/api/apis/AgentApi.ts index 0730970d..7ccb6f92 100644 --- a/ui/src/api/apis/AgentApi.ts +++ b/ui/src/api/apis/AgentApi.ts @@ -20,6 +20,7 @@ import type { Ping200Response, RemoteShare200Response, RemoteShareRequest, + RemoteStatus200Response, RemoteUnshareRequest, } from '../models/index'; import { @@ -33,6 +34,8 @@ import { RemoteShare200ResponseToJSON, RemoteShareRequestFromJSON, RemoteShareRequestToJSON, + RemoteStatus200ResponseFromJSON, + RemoteStatus200ResponseToJSON, RemoteUnshareRequestFromJSON, RemoteUnshareRequestToJSON, } from '../models/index'; @@ -49,6 +52,10 @@ export interface RemoteShareOperationRequest { body?: RemoteShareRequest; } +export interface RemoteStatusRequest { + body?: EnrollRequest; +} + export interface RemoteUnshareOperationRequest { body?: RemoteUnshareRequest; } @@ -155,6 +162,37 @@ export class AgentApi extends runtime.BaseAPI { return await response.value(); } + /** + */ + async remoteStatusRaw(requestParameters: RemoteStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/zrok.v1+json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication + } + + const response = await this.request({ + path: `/agent/status`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: EnrollRequestToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RemoteStatus200ResponseFromJSON(jsonValue)); + } + + /** + */ + async remoteStatus(requestParameters: RemoteStatusRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.remoteStatusRaw(requestParameters, initOverrides); + return await response.value(); + } + /** */ async remoteUnshareRaw(requestParameters: RemoteUnshareOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { diff --git a/ui/src/api/models/RemoteStatus200Response.ts b/ui/src/api/models/RemoteStatus200Response.ts new file mode 100644 index 00000000..e8da81ea --- /dev/null +++ b/ui/src/api/models/RemoteStatus200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { RemoteStatus200ResponseSharesInner } from './RemoteStatus200ResponseSharesInner'; +import { + RemoteStatus200ResponseSharesInnerFromJSON, + RemoteStatus200ResponseSharesInnerFromJSONTyped, + RemoteStatus200ResponseSharesInnerToJSON, + RemoteStatus200ResponseSharesInnerToJSONTyped, +} from './RemoteStatus200ResponseSharesInner'; +import type { RemoteStatus200ResponseAccessesInner } from './RemoteStatus200ResponseAccessesInner'; +import { + RemoteStatus200ResponseAccessesInnerFromJSON, + RemoteStatus200ResponseAccessesInnerFromJSONTyped, + RemoteStatus200ResponseAccessesInnerToJSON, + RemoteStatus200ResponseAccessesInnerToJSONTyped, +} from './RemoteStatus200ResponseAccessesInner'; + +/** + * + * @export + * @interface RemoteStatus200Response + */ +export interface RemoteStatus200Response { + /** + * + * @type {Array} + * @memberof RemoteStatus200Response + */ + shares?: Array; + /** + * + * @type {Array} + * @memberof RemoteStatus200Response + */ + accesses?: Array; +} + +/** + * Check if a given object implements the RemoteStatus200Response interface. + */ +export function instanceOfRemoteStatus200Response(value: object): value is RemoteStatus200Response { + return true; +} + +export function RemoteStatus200ResponseFromJSON(json: any): RemoteStatus200Response { + return RemoteStatus200ResponseFromJSONTyped(json, false); +} + +export function RemoteStatus200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RemoteStatus200Response { + if (json == null) { + return json; + } + return { + + 'shares': json['shares'] == null ? undefined : ((json['shares'] as Array).map(RemoteStatus200ResponseSharesInnerFromJSON)), + 'accesses': json['accesses'] == null ? undefined : ((json['accesses'] as Array).map(RemoteStatus200ResponseAccessesInnerFromJSON)), + }; +} + +export function RemoteStatus200ResponseToJSON(json: any): RemoteStatus200Response { + return RemoteStatus200ResponseToJSONTyped(json, false); +} + +export function RemoteStatus200ResponseToJSONTyped(value?: RemoteStatus200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'shares': value['shares'] == null ? undefined : ((value['shares'] as Array).map(RemoteStatus200ResponseSharesInnerToJSON)), + 'accesses': value['accesses'] == null ? undefined : ((value['accesses'] as Array).map(RemoteStatus200ResponseAccessesInnerToJSON)), + }; +} + diff --git a/ui/src/api/models/RemoteStatus200ResponseAccessesInner.ts b/ui/src/api/models/RemoteStatus200ResponseAccessesInner.ts new file mode 100644 index 00000000..a0e217e1 --- /dev/null +++ b/ui/src/api/models/RemoteStatus200ResponseAccessesInner.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface RemoteStatus200ResponseAccessesInner + */ +export interface RemoteStatus200ResponseAccessesInner { + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseAccessesInner + */ + frontendToken?: string; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseAccessesInner + */ + token?: string; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseAccessesInner + */ + bindAddress?: string; + /** + * + * @type {Array} + * @memberof RemoteStatus200ResponseAccessesInner + */ + responseHeaders?: Array; +} + +/** + * Check if a given object implements the RemoteStatus200ResponseAccessesInner interface. + */ +export function instanceOfRemoteStatus200ResponseAccessesInner(value: object): value is RemoteStatus200ResponseAccessesInner { + return true; +} + +export function RemoteStatus200ResponseAccessesInnerFromJSON(json: any): RemoteStatus200ResponseAccessesInner { + return RemoteStatus200ResponseAccessesInnerFromJSONTyped(json, false); +} + +export function RemoteStatus200ResponseAccessesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RemoteStatus200ResponseAccessesInner { + if (json == null) { + return json; + } + return { + + 'frontendToken': json['frontendToken'] == null ? undefined : json['frontendToken'], + 'token': json['token'] == null ? undefined : json['token'], + 'bindAddress': json['bindAddress'] == null ? undefined : json['bindAddress'], + 'responseHeaders': json['responseHeaders'] == null ? undefined : json['responseHeaders'], + }; +} + +export function RemoteStatus200ResponseAccessesInnerToJSON(json: any): RemoteStatus200ResponseAccessesInner { + return RemoteStatus200ResponseAccessesInnerToJSONTyped(json, false); +} + +export function RemoteStatus200ResponseAccessesInnerToJSONTyped(value?: RemoteStatus200ResponseAccessesInner | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'frontendToken': value['frontendToken'], + 'token': value['token'], + 'bindAddress': value['bindAddress'], + 'responseHeaders': value['responseHeaders'], + }; +} + diff --git a/ui/src/api/models/RemoteStatus200ResponseSharesInner.ts b/ui/src/api/models/RemoteStatus200ResponseSharesInner.ts new file mode 100644 index 00000000..c34aa0b8 --- /dev/null +++ b/ui/src/api/models/RemoteStatus200ResponseSharesInner.ts @@ -0,0 +1,121 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface RemoteStatus200ResponseSharesInner + */ +export interface RemoteStatus200ResponseSharesInner { + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseSharesInner + */ + token?: string; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseSharesInner + */ + shareMode?: string; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseSharesInner + */ + backendMode?: string; + /** + * + * @type {boolean} + * @memberof RemoteStatus200ResponseSharesInner + */ + reserved?: boolean; + /** + * + * @type {Array} + * @memberof RemoteStatus200ResponseSharesInner + */ + frontendEndpoints?: Array; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseSharesInner + */ + backendEndpoint?: string; + /** + * + * @type {boolean} + * @memberof RemoteStatus200ResponseSharesInner + */ + open?: boolean; + /** + * + * @type {string} + * @memberof RemoteStatus200ResponseSharesInner + */ + status?: string; +} + +/** + * Check if a given object implements the RemoteStatus200ResponseSharesInner interface. + */ +export function instanceOfRemoteStatus200ResponseSharesInner(value: object): value is RemoteStatus200ResponseSharesInner { + return true; +} + +export function RemoteStatus200ResponseSharesInnerFromJSON(json: any): RemoteStatus200ResponseSharesInner { + return RemoteStatus200ResponseSharesInnerFromJSONTyped(json, false); +} + +export function RemoteStatus200ResponseSharesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RemoteStatus200ResponseSharesInner { + if (json == null) { + return json; + } + return { + + 'token': json['token'] == null ? undefined : json['token'], + 'shareMode': json['shareMode'] == null ? undefined : json['shareMode'], + 'backendMode': json['backendMode'] == null ? undefined : json['backendMode'], + 'reserved': json['reserved'] == null ? undefined : json['reserved'], + 'frontendEndpoints': json['frontendEndpoints'] == null ? undefined : json['frontendEndpoints'], + 'backendEndpoint': json['backendEndpoint'] == null ? undefined : json['backendEndpoint'], + 'open': json['open'] == null ? undefined : json['open'], + 'status': json['status'] == null ? undefined : json['status'], + }; +} + +export function RemoteStatus200ResponseSharesInnerToJSON(json: any): RemoteStatus200ResponseSharesInner { + return RemoteStatus200ResponseSharesInnerToJSONTyped(json, false); +} + +export function RemoteStatus200ResponseSharesInnerToJSONTyped(value?: RemoteStatus200ResponseSharesInner | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'token': value['token'], + 'shareMode': value['shareMode'], + 'backendMode': value['backendMode'], + 'reserved': value['reserved'], + 'frontendEndpoints': value['frontendEndpoints'], + 'backendEndpoint': value['backendEndpoint'], + 'open': value['open'], + 'status': value['status'], + }; +} + diff --git a/ui/src/api/models/index.ts b/ui/src/api/models/index.ts index fa868bdd..f380a124 100644 --- a/ui/src/api/models/index.ts +++ b/ui/src/api/models/index.ts @@ -42,6 +42,9 @@ export * from './RegenerateAccountTokenRequest'; export * from './RegisterRequest'; export * from './RemoteShare200Response'; export * from './RemoteShareRequest'; +export * from './RemoteStatus200Response'; +export * from './RemoteStatus200ResponseAccessesInner'; +export * from './RemoteStatus200ResponseSharesInner'; export * from './RemoteUnshareRequest'; export * from './RemoveOrganizationMemberRequest'; export * from './ResetPasswordRequest';