mirror of
https://github.com/openziti/zrok.git
synced 2025-06-24 11:41:25 +02:00
/agent/status api endpoint rough-in (#967)
This commit is contained in:
parent
0c6dedc01c
commit
9cfd4646f8
@ -106,6 +106,8 @@ type ClientService interface {
|
|||||||
|
|
||||||
RemoteShare(params *RemoteShareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoteShareOK, error)
|
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)
|
RemoteUnshare(params *RemoteUnshareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoteUnshareOK, error)
|
||||||
|
|
||||||
Unenroll(params *UnenrollParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnenrollOK, 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)
|
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
|
RemoteUnshare remote unshare API
|
||||||
*/
|
*/
|
||||||
|
146
rest_client_zrok/agent/remote_status_parameters.go
Normal file
146
rest_client_zrok/agent/remote_status_parameters.go
Normal file
@ -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
|
||||||
|
}
|
607
rest_client_zrok/agent/remote_status_responses.go
Normal file
607
rest_client_zrok/agent/remote_status_responses.go
Normal file
@ -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
|
||||||
|
}
|
@ -227,7 +227,7 @@ func NewUnenrollInternalServerError() *UnenrollInternalServerError {
|
|||||||
/*
|
/*
|
||||||
UnenrollInternalServerError describes a response with status code 500, with default header values.
|
UnenrollInternalServerError describes a response with status code 500, with default header values.
|
||||||
|
|
||||||
UnenrollInternalServerError unenroll internal server error
|
internal server error
|
||||||
*/
|
*/
|
||||||
type UnenrollInternalServerError struct {
|
type UnenrollInternalServerError struct {
|
||||||
}
|
}
|
||||||
|
@ -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": {
|
"/agent/unenroll": {
|
||||||
"post": {
|
"post": {
|
||||||
"security": [
|
"security": [
|
||||||
@ -430,7 +532,7 @@ func init() {
|
|||||||
"description": "unauthorized"
|
"description": "unauthorized"
|
||||||
},
|
},
|
||||||
"500": {
|
"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": {
|
"/agent/unenroll": {
|
||||||
"post": {
|
"post": {
|
||||||
"security": [
|
"security": [
|
||||||
@ -3034,7 +3192,7 @@ func init() {
|
|||||||
"description": "unauthorized"
|
"description": "unauthorized"
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": ""
|
"description": "internal server error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4811,6 +4969,26 @@ func init() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
|
"AccessesItems0": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"bindAddress": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"frontendToken": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"responseHeaders": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"token": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"ListFrontendsOKBodyItems0": {
|
"ListFrontendsOKBodyItems0": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"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": {
|
"authUser": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
385
rest_server_zrok/operations/agent/remote_status.go
Normal file
385
rest_server_zrok/operations/agent/remote_status.go
Normal file
@ -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
|
||||||
|
}
|
@ -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
|
||||||
|
}
|
132
rest_server_zrok/operations/agent/remote_status_responses.go
Normal file
132
rest_server_zrok/operations/agent/remote_status_responses.go
Normal file
@ -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)
|
||||||
|
}
|
@ -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()
|
||||||
|
}
|
@ -90,7 +90,7 @@ func (o *UnenrollUnauthorized) WriteResponse(rw http.ResponseWriter, producer ru
|
|||||||
const UnenrollInternalServerErrorCode int = 500
|
const UnenrollInternalServerErrorCode int = 500
|
||||||
|
|
||||||
/*
|
/*
|
||||||
UnenrollInternalServerError unenroll internal server error
|
UnenrollInternalServerError internal server error
|
||||||
|
|
||||||
swagger:response unenrollInternalServerError
|
swagger:response unenrollInternalServerError
|
||||||
*/
|
*/
|
||||||
|
@ -161,6 +161,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
|
|||||||
AgentRemoteShareHandler: agent.RemoteShareHandlerFunc(func(params agent.RemoteShareParams, principal *rest_model_zrok.Principal) middleware.Responder {
|
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")
|
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 {
|
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")
|
return middleware.NotImplemented("operation agent.RemoteUnshare has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
@ -327,6 +330,8 @@ type ZrokAPI struct {
|
|||||||
AccountRegisterHandler account.RegisterHandler
|
AccountRegisterHandler account.RegisterHandler
|
||||||
// AgentRemoteShareHandler sets the operation handler for the remote share operation
|
// AgentRemoteShareHandler sets the operation handler for the remote share operation
|
||||||
AgentRemoteShareHandler agent.RemoteShareHandler
|
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 sets the operation handler for the remote unshare operation
|
||||||
AgentRemoteUnshareHandler agent.RemoteUnshareHandler
|
AgentRemoteUnshareHandler agent.RemoteUnshareHandler
|
||||||
// AdminRemoveOrganizationMemberHandler sets the operation handler for the remove organization member operation
|
// AdminRemoveOrganizationMemberHandler sets the operation handler for the remove organization member operation
|
||||||
@ -547,6 +552,9 @@ func (o *ZrokAPI) Validate() error {
|
|||||||
if o.AgentRemoteShareHandler == nil {
|
if o.AgentRemoteShareHandler == nil {
|
||||||
unregistered = append(unregistered, "agent.RemoteShareHandler")
|
unregistered = append(unregistered, "agent.RemoteShareHandler")
|
||||||
}
|
}
|
||||||
|
if o.AgentRemoteStatusHandler == nil {
|
||||||
|
unregistered = append(unregistered, "agent.RemoteStatusHandler")
|
||||||
|
}
|
||||||
if o.AgentRemoteUnshareHandler == nil {
|
if o.AgentRemoteUnshareHandler == nil {
|
||||||
unregistered = append(unregistered, "agent.RemoteUnshareHandler")
|
unregistered = append(unregistered, "agent.RemoteUnshareHandler")
|
||||||
}
|
}
|
||||||
@ -839,6 +847,10 @@ func (o *ZrokAPI) initHandlerCache() {
|
|||||||
if o.handlers["POST"] == nil {
|
if o.handlers["POST"] == nil {
|
||||||
o.handlers["POST"] = make(map[string]http.Handler)
|
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)
|
o.handlers["POST"]["/agent/unshare"] = agent.NewRemoteUnshare(o.context, o.AgentRemoteUnshareHandler)
|
||||||
if o.handlers["POST"] == nil {
|
if o.handlers["POST"] == nil {
|
||||||
o.handlers["POST"] = make(map[string]http.Handler)
|
o.handlers["POST"] = make(map[string]http.Handler)
|
||||||
|
@ -49,6 +49,9 @@ models/RegenerateAccountTokenRequest.ts
|
|||||||
models/RegisterRequest.ts
|
models/RegisterRequest.ts
|
||||||
models/RemoteShare200Response.ts
|
models/RemoteShare200Response.ts
|
||||||
models/RemoteShareRequest.ts
|
models/RemoteShareRequest.ts
|
||||||
|
models/RemoteStatus200Response.ts
|
||||||
|
models/RemoteStatus200ResponseAccessesInner.ts
|
||||||
|
models/RemoteStatus200ResponseSharesInner.ts
|
||||||
models/RemoteUnshareRequest.ts
|
models/RemoteUnshareRequest.ts
|
||||||
models/RemoveOrganizationMemberRequest.ts
|
models/RemoveOrganizationMemberRequest.ts
|
||||||
models/ResetPasswordRequest.ts
|
models/ResetPasswordRequest.ts
|
||||||
|
@ -20,6 +20,7 @@ import type {
|
|||||||
Ping200Response,
|
Ping200Response,
|
||||||
RemoteShare200Response,
|
RemoteShare200Response,
|
||||||
RemoteShareRequest,
|
RemoteShareRequest,
|
||||||
|
RemoteStatus200Response,
|
||||||
RemoteUnshareRequest,
|
RemoteUnshareRequest,
|
||||||
} from '../models/index';
|
} from '../models/index';
|
||||||
import {
|
import {
|
||||||
@ -33,6 +34,8 @@ import {
|
|||||||
RemoteShare200ResponseToJSON,
|
RemoteShare200ResponseToJSON,
|
||||||
RemoteShareRequestFromJSON,
|
RemoteShareRequestFromJSON,
|
||||||
RemoteShareRequestToJSON,
|
RemoteShareRequestToJSON,
|
||||||
|
RemoteStatus200ResponseFromJSON,
|
||||||
|
RemoteStatus200ResponseToJSON,
|
||||||
RemoteUnshareRequestFromJSON,
|
RemoteUnshareRequestFromJSON,
|
||||||
RemoteUnshareRequestToJSON,
|
RemoteUnshareRequestToJSON,
|
||||||
} from '../models/index';
|
} from '../models/index';
|
||||||
@ -49,6 +52,10 @@ export interface RemoteShareOperationRequest {
|
|||||||
body?: RemoteShareRequest;
|
body?: RemoteShareRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface RemoteStatusRequest {
|
||||||
|
body?: EnrollRequest;
|
||||||
|
}
|
||||||
|
|
||||||
export interface RemoteUnshareOperationRequest {
|
export interface RemoteUnshareOperationRequest {
|
||||||
body?: RemoteUnshareRequest;
|
body?: RemoteUnshareRequest;
|
||||||
}
|
}
|
||||||
@ -155,6 +162,37 @@ export class AgentApi extends runtime.BaseAPI {
|
|||||||
return await response.value();
|
return await response.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
async remoteStatusRaw(requestParameters: RemoteStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RemoteStatus200Response>> {
|
||||||
|
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<RemoteStatus200Response> {
|
||||||
|
const response = await this.remoteStatusRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
async remoteUnshareRaw(requestParameters: RemoteUnshareOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
async remoteUnshareRaw(requestParameters: RemoteUnshareOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
88
sdk/nodejs/sdk/src/api/models/RemoteStatus200Response.ts
Normal file
88
sdk/nodejs/sdk/src/api/models/RemoteStatus200Response.ts
Normal file
@ -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<RemoteStatus200ResponseSharesInner>}
|
||||||
|
* @memberof RemoteStatus200Response
|
||||||
|
*/
|
||||||
|
shares?: Array<RemoteStatus200ResponseSharesInner>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<RemoteStatus200ResponseAccessesInner>}
|
||||||
|
* @memberof RemoteStatus200Response
|
||||||
|
*/
|
||||||
|
accesses?: Array<RemoteStatus200ResponseAccessesInner>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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<any>).map(RemoteStatus200ResponseSharesInnerFromJSON)),
|
||||||
|
'accesses': json['accesses'] == null ? undefined : ((json['accesses'] as Array<any>).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<any>).map(RemoteStatus200ResponseSharesInnerToJSON)),
|
||||||
|
'accesses': value['accesses'] == null ? undefined : ((value['accesses'] as Array<any>).map(RemoteStatus200ResponseAccessesInnerToJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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<string>}
|
||||||
|
* @memberof RemoteStatus200ResponseAccessesInner
|
||||||
|
*/
|
||||||
|
responseHeaders?: Array<string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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<string>}
|
||||||
|
* @memberof RemoteStatus200ResponseSharesInner
|
||||||
|
*/
|
||||||
|
frontendEndpoints?: Array<string>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -42,6 +42,9 @@ export * from './RegenerateAccountTokenRequest';
|
|||||||
export * from './RegisterRequest';
|
export * from './RegisterRequest';
|
||||||
export * from './RemoteShare200Response';
|
export * from './RemoteShare200Response';
|
||||||
export * from './RemoteShareRequest';
|
export * from './RemoteShareRequest';
|
||||||
|
export * from './RemoteStatus200Response';
|
||||||
|
export * from './RemoteStatus200ResponseAccessesInner';
|
||||||
|
export * from './RemoteStatus200ResponseSharesInner';
|
||||||
export * from './RemoteUnshareRequest';
|
export * from './RemoteUnshareRequest';
|
||||||
export * from './RemoveOrganizationMemberRequest';
|
export * from './RemoveOrganizationMemberRequest';
|
||||||
export * from './ResetPasswordRequest';
|
export * from './ResetPasswordRequest';
|
||||||
|
@ -47,6 +47,9 @@ docs/RegenerateAccountTokenRequest.md
|
|||||||
docs/RegisterRequest.md
|
docs/RegisterRequest.md
|
||||||
docs/RemoteShare200Response.md
|
docs/RemoteShare200Response.md
|
||||||
docs/RemoteShareRequest.md
|
docs/RemoteShareRequest.md
|
||||||
|
docs/RemoteStatus200Response.md
|
||||||
|
docs/RemoteStatus200ResponseAccessesInner.md
|
||||||
|
docs/RemoteStatus200ResponseSharesInner.md
|
||||||
docs/RemoteUnshareRequest.md
|
docs/RemoteUnshareRequest.md
|
||||||
docs/RemoveOrganizationMemberRequest.md
|
docs/RemoveOrganizationMemberRequest.md
|
||||||
docs/ResetPasswordRequest.md
|
docs/ResetPasswordRequest.md
|
||||||
@ -113,6 +116,9 @@ test/test_regenerate_account_token_request.py
|
|||||||
test/test_register_request.py
|
test/test_register_request.py
|
||||||
test/test_remote_share200_response.py
|
test/test_remote_share200_response.py
|
||||||
test/test_remote_share_request.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_remote_unshare_request.py
|
||||||
test/test_remove_organization_member_request.py
|
test/test_remove_organization_member_request.py
|
||||||
test/test_reset_password_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/register_request.py
|
||||||
zrok_api/models/remote_share200_response.py
|
zrok_api/models/remote_share200_response.py
|
||||||
zrok_api/models/remote_share_request.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/remote_unshare_request.py
|
||||||
zrok_api/models/remove_organization_member_request.py
|
zrok_api/models/remove_organization_member_request.py
|
||||||
zrok_api/models/reset_password_request.py
|
zrok_api/models/reset_password_request.py
|
||||||
|
@ -117,6 +117,7 @@ Class | Method | HTTP request | Description
|
|||||||
*AgentApi* | [**enroll**](docs/AgentApi.md#enroll) | **POST** /agent/enroll |
|
*AgentApi* | [**enroll**](docs/AgentApi.md#enroll) | **POST** /agent/enroll |
|
||||||
*AgentApi* | [**ping**](docs/AgentApi.md#ping) | **POST** /agent/ping |
|
*AgentApi* | [**ping**](docs/AgentApi.md#ping) | **POST** /agent/ping |
|
||||||
*AgentApi* | [**remote_share**](docs/AgentApi.md#remote_share) | **POST** /agent/share |
|
*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* | [**remote_unshare**](docs/AgentApi.md#remote_unshare) | **POST** /agent/unshare |
|
||||||
*AgentApi* | [**unenroll**](docs/AgentApi.md#unenroll) | **POST** /agent/unenroll |
|
*AgentApi* | [**unenroll**](docs/AgentApi.md#unenroll) | **POST** /agent/unenroll |
|
||||||
*EnvironmentApi* | [**disable**](docs/EnvironmentApi.md#disable) | **POST** /disable |
|
*EnvironmentApi* | [**disable**](docs/EnvironmentApi.md#disable) | **POST** /disable |
|
||||||
@ -189,6 +190,9 @@ Class | Method | HTTP request | Description
|
|||||||
- [RegisterRequest](docs/RegisterRequest.md)
|
- [RegisterRequest](docs/RegisterRequest.md)
|
||||||
- [RemoteShare200Response](docs/RemoteShare200Response.md)
|
- [RemoteShare200Response](docs/RemoteShare200Response.md)
|
||||||
- [RemoteShareRequest](docs/RemoteShareRequest.md)
|
- [RemoteShareRequest](docs/RemoteShareRequest.md)
|
||||||
|
- [RemoteStatus200Response](docs/RemoteStatus200Response.md)
|
||||||
|
- [RemoteStatus200ResponseAccessesInner](docs/RemoteStatus200ResponseAccessesInner.md)
|
||||||
|
- [RemoteStatus200ResponseSharesInner](docs/RemoteStatus200ResponseSharesInner.md)
|
||||||
- [RemoteUnshareRequest](docs/RemoteUnshareRequest.md)
|
- [RemoteUnshareRequest](docs/RemoteUnshareRequest.md)
|
||||||
- [RemoveOrganizationMemberRequest](docs/RemoveOrganizationMemberRequest.md)
|
- [RemoveOrganizationMemberRequest](docs/RemoveOrganizationMemberRequest.md)
|
||||||
- [ResetPasswordRequest](docs/ResetPasswordRequest.md)
|
- [ResetPasswordRequest](docs/ResetPasswordRequest.md)
|
||||||
|
@ -7,6 +7,7 @@ Method | HTTP request | Description
|
|||||||
[**enroll**](AgentApi.md#enroll) | **POST** /agent/enroll |
|
[**enroll**](AgentApi.md#enroll) | **POST** /agent/enroll |
|
||||||
[**ping**](AgentApi.md#ping) | **POST** /agent/ping |
|
[**ping**](AgentApi.md#ping) | **POST** /agent/ping |
|
||||||
[**remote_share**](AgentApi.md#remote_share) | **POST** /agent/share |
|
[**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 |
|
[**remote_unshare**](AgentApi.md#remote_unshare) | **POST** /agent/unshare |
|
||||||
[**unenroll**](AgentApi.md#unenroll) | **POST** /agent/unenroll |
|
[**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)
|
[[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**
|
||||||
> remote_unshare(body=body)
|
> remote_unshare(body=body)
|
||||||
|
|
||||||
@ -391,6 +470,7 @@ void (empty response body)
|
|||||||
**200** | ok | - |
|
**200** | ok | - |
|
||||||
**400** | bad request; not enrolled | - |
|
**400** | bad request; not enrolled | - |
|
||||||
**401** | unauthorized | - |
|
**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)
|
[[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)
|
||||||
|
|
||||||
|
30
sdk/python/src/docs/RemoteStatus200Response.md
Normal file
30
sdk/python/src/docs/RemoteStatus200Response.md
Normal file
@ -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)
|
||||||
|
|
||||||
|
|
32
sdk/python/src/docs/RemoteStatus200ResponseAccessesInner.md
Normal file
32
sdk/python/src/docs/RemoteStatus200ResponseAccessesInner.md
Normal file
@ -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)
|
||||||
|
|
||||||
|
|
36
sdk/python/src/docs/RemoteStatus200ResponseSharesInner.md
Normal file
36
sdk/python/src/docs/RemoteStatus200ResponseSharesInner.md
Normal file
@ -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)
|
||||||
|
|
||||||
|
|
@ -44,6 +44,12 @@ class TestAgentApi(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def test_remote_status(self) -> None:
|
||||||
|
"""Test case for remote_status
|
||||||
|
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
def test_remote_unshare(self) -> None:
|
def test_remote_unshare(self) -> None:
|
||||||
"""Test case for remote_unshare
|
"""Test case for remote_unshare
|
||||||
|
|
||||||
|
72
sdk/python/src/test/test_remote_status200_response.py
Normal file
72
sdk/python/src/test/test_remote_status200_response.py
Normal file
@ -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()
|
@ -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()
|
@ -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()
|
@ -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.register_request import RegisterRequest
|
||||||
from zrok_api.models.remote_share200_response import RemoteShare200Response
|
from zrok_api.models.remote_share200_response import RemoteShare200Response
|
||||||
from zrok_api.models.remote_share_request import RemoteShareRequest
|
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.remote_unshare_request import RemoteUnshareRequest
|
||||||
from zrok_api.models.remove_organization_member_request import RemoveOrganizationMemberRequest
|
from zrok_api.models.remove_organization_member_request import RemoveOrganizationMemberRequest
|
||||||
from zrok_api.models.reset_password_request import ResetPasswordRequest
|
from zrok_api.models.reset_password_request import ResetPasswordRequest
|
||||||
|
@ -22,6 +22,7 @@ from zrok_api.models.enroll_request import EnrollRequest
|
|||||||
from zrok_api.models.ping200_response import Ping200Response
|
from zrok_api.models.ping200_response import Ping200Response
|
||||||
from zrok_api.models.remote_share200_response import RemoteShare200Response
|
from zrok_api.models.remote_share200_response import RemoteShare200Response
|
||||||
from zrok_api.models.remote_share_request import RemoteShareRequest
|
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.models.remote_unshare_request import RemoteUnshareRequest
|
||||||
|
|
||||||
from zrok_api.api_client import ApiClient, RequestSerialized
|
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
|
@validate_call
|
||||||
def remote_unshare(
|
def remote_unshare(
|
||||||
self,
|
self,
|
||||||
@ -1211,6 +1492,7 @@ class AgentApi:
|
|||||||
'200': None,
|
'200': None,
|
||||||
'400': None,
|
'400': None,
|
||||||
'401': None,
|
'401': None,
|
||||||
|
'500': None,
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1279,6 +1561,7 @@ class AgentApi:
|
|||||||
'200': None,
|
'200': None,
|
||||||
'400': None,
|
'400': None,
|
||||||
'401': None,
|
'401': None,
|
||||||
|
'500': None,
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1347,6 +1630,7 @@ class AgentApi:
|
|||||||
'200': None,
|
'200': None,
|
||||||
'400': None,
|
'400': None,
|
||||||
'401': None,
|
'401': None,
|
||||||
|
'500': None,
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
|
@ -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.register_request import RegisterRequest
|
||||||
from zrok_api.models.remote_share200_response import RemoteShare200Response
|
from zrok_api.models.remote_share200_response import RemoteShare200Response
|
||||||
from zrok_api.models.remote_share_request import RemoteShareRequest
|
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.remote_unshare_request import RemoteUnshareRequest
|
||||||
from zrok_api.models.remove_organization_member_request import RemoveOrganizationMemberRequest
|
from zrok_api.models.remove_organization_member_request import RemoveOrganizationMemberRequest
|
||||||
from zrok_api.models.reset_password_request import ResetPasswordRequest
|
from zrok_api.models.reset_password_request import ResetPasswordRequest
|
||||||
|
105
sdk/python/src/zrok_api/models/remote_status200_response.py
Normal file
105
sdk/python/src/zrok_api/models/remote_status200_response.py
Normal file
@ -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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -738,6 +738,70 @@ paths:
|
|||||||
502:
|
502:
|
||||||
description: bad gateway; agent not reachable
|
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:
|
/agent/unenroll:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
@ -760,6 +824,7 @@ paths:
|
|||||||
401:
|
401:
|
||||||
description: unauthorized
|
description: unauthorized
|
||||||
500:
|
500:
|
||||||
|
description: internal server error
|
||||||
|
|
||||||
/agent/unshare:
|
/agent/unshare:
|
||||||
post:
|
post:
|
||||||
|
@ -49,6 +49,9 @@ models/RegenerateAccountTokenRequest.ts
|
|||||||
models/RegisterRequest.ts
|
models/RegisterRequest.ts
|
||||||
models/RemoteShare200Response.ts
|
models/RemoteShare200Response.ts
|
||||||
models/RemoteShareRequest.ts
|
models/RemoteShareRequest.ts
|
||||||
|
models/RemoteStatus200Response.ts
|
||||||
|
models/RemoteStatus200ResponseAccessesInner.ts
|
||||||
|
models/RemoteStatus200ResponseSharesInner.ts
|
||||||
models/RemoteUnshareRequest.ts
|
models/RemoteUnshareRequest.ts
|
||||||
models/RemoveOrganizationMemberRequest.ts
|
models/RemoveOrganizationMemberRequest.ts
|
||||||
models/ResetPasswordRequest.ts
|
models/ResetPasswordRequest.ts
|
||||||
|
@ -20,6 +20,7 @@ import type {
|
|||||||
Ping200Response,
|
Ping200Response,
|
||||||
RemoteShare200Response,
|
RemoteShare200Response,
|
||||||
RemoteShareRequest,
|
RemoteShareRequest,
|
||||||
|
RemoteStatus200Response,
|
||||||
RemoteUnshareRequest,
|
RemoteUnshareRequest,
|
||||||
} from '../models/index';
|
} from '../models/index';
|
||||||
import {
|
import {
|
||||||
@ -33,6 +34,8 @@ import {
|
|||||||
RemoteShare200ResponseToJSON,
|
RemoteShare200ResponseToJSON,
|
||||||
RemoteShareRequestFromJSON,
|
RemoteShareRequestFromJSON,
|
||||||
RemoteShareRequestToJSON,
|
RemoteShareRequestToJSON,
|
||||||
|
RemoteStatus200ResponseFromJSON,
|
||||||
|
RemoteStatus200ResponseToJSON,
|
||||||
RemoteUnshareRequestFromJSON,
|
RemoteUnshareRequestFromJSON,
|
||||||
RemoteUnshareRequestToJSON,
|
RemoteUnshareRequestToJSON,
|
||||||
} from '../models/index';
|
} from '../models/index';
|
||||||
@ -49,6 +52,10 @@ export interface RemoteShareOperationRequest {
|
|||||||
body?: RemoteShareRequest;
|
body?: RemoteShareRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface RemoteStatusRequest {
|
||||||
|
body?: EnrollRequest;
|
||||||
|
}
|
||||||
|
|
||||||
export interface RemoteUnshareOperationRequest {
|
export interface RemoteUnshareOperationRequest {
|
||||||
body?: RemoteUnshareRequest;
|
body?: RemoteUnshareRequest;
|
||||||
}
|
}
|
||||||
@ -155,6 +162,37 @@ export class AgentApi extends runtime.BaseAPI {
|
|||||||
return await response.value();
|
return await response.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
async remoteStatusRaw(requestParameters: RemoteStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RemoteStatus200Response>> {
|
||||||
|
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<RemoteStatus200Response> {
|
||||||
|
const response = await this.remoteStatusRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
async remoteUnshareRaw(requestParameters: RemoteUnshareOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
async remoteUnshareRaw(requestParameters: RemoteUnshareOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
88
ui/src/api/models/RemoteStatus200Response.ts
Normal file
88
ui/src/api/models/RemoteStatus200Response.ts
Normal file
@ -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<RemoteStatus200ResponseSharesInner>}
|
||||||
|
* @memberof RemoteStatus200Response
|
||||||
|
*/
|
||||||
|
shares?: Array<RemoteStatus200ResponseSharesInner>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<RemoteStatus200ResponseAccessesInner>}
|
||||||
|
* @memberof RemoteStatus200Response
|
||||||
|
*/
|
||||||
|
accesses?: Array<RemoteStatus200ResponseAccessesInner>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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<any>).map(RemoteStatus200ResponseSharesInnerFromJSON)),
|
||||||
|
'accesses': json['accesses'] == null ? undefined : ((json['accesses'] as Array<any>).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<any>).map(RemoteStatus200ResponseSharesInnerToJSON)),
|
||||||
|
'accesses': value['accesses'] == null ? undefined : ((value['accesses'] as Array<any>).map(RemoteStatus200ResponseAccessesInnerToJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
89
ui/src/api/models/RemoteStatus200ResponseAccessesInner.ts
Normal file
89
ui/src/api/models/RemoteStatus200ResponseAccessesInner.ts
Normal file
@ -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<string>}
|
||||||
|
* @memberof RemoteStatus200ResponseAccessesInner
|
||||||
|
*/
|
||||||
|
responseHeaders?: Array<string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
121
ui/src/api/models/RemoteStatus200ResponseSharesInner.ts
Normal file
121
ui/src/api/models/RemoteStatus200ResponseSharesInner.ts
Normal file
@ -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<string>}
|
||||||
|
* @memberof RemoteStatus200ResponseSharesInner
|
||||||
|
*/
|
||||||
|
frontendEndpoints?: Array<string>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -42,6 +42,9 @@ export * from './RegenerateAccountTokenRequest';
|
|||||||
export * from './RegisterRequest';
|
export * from './RegisterRequest';
|
||||||
export * from './RemoteShare200Response';
|
export * from './RemoteShare200Response';
|
||||||
export * from './RemoteShareRequest';
|
export * from './RemoteShareRequest';
|
||||||
|
export * from './RemoteStatus200Response';
|
||||||
|
export * from './RemoteStatus200ResponseAccessesInner';
|
||||||
|
export * from './RemoteStatus200ResponseSharesInner';
|
||||||
export * from './RemoteUnshareRequest';
|
export * from './RemoteUnshareRequest';
|
||||||
export * from './RemoveOrganizationMemberRequest';
|
export * from './RemoveOrganizationMemberRequest';
|
||||||
export * from './ResetPasswordRequest';
|
export * from './ResetPasswordRequest';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user