feat: add flags for remotes, replications, and functions to auth create
(#325)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,6 +20,7 @@ vendor/
|
|||||||
# Docs generated from our openapi repo
|
# Docs generated from our openapi repo
|
||||||
api/cli.yml
|
api/cli.yml
|
||||||
api/cli.gen.yml
|
api/cli.gen.yml
|
||||||
|
api/cli-extras.gen.yml
|
||||||
|
|
||||||
# GPG private key generated by CI during release.
|
# GPG private key generated by CI during release.
|
||||||
private.key
|
private.key
|
||||||
|
@ -23,7 +23,7 @@ var (
|
|||||||
_ _context.Context
|
_ _context.Context
|
||||||
)
|
)
|
||||||
|
|
||||||
type ResourceListApi interface {
|
type ResourcesApi interface {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GetResources List all known resources
|
* GetResources List all known resources
|
||||||
@ -41,30 +41,30 @@ type ResourceListApi interface {
|
|||||||
// Sets additional descriptive text in the error message if any request in
|
// Sets additional descriptive text in the error message if any request in
|
||||||
// this API fails, indicating that it is intended to be used only on OSS
|
// this API fails, indicating that it is intended to be used only on OSS
|
||||||
// servers.
|
// servers.
|
||||||
OnlyOSS() ResourceListApi
|
OnlyOSS() ResourcesApi
|
||||||
|
|
||||||
// Sets additional descriptive text in the error message if any request in
|
// Sets additional descriptive text in the error message if any request in
|
||||||
// this API fails, indicating that it is intended to be used only on cloud
|
// this API fails, indicating that it is intended to be used only on cloud
|
||||||
// servers.
|
// servers.
|
||||||
OnlyCloud() ResourceListApi
|
OnlyCloud() ResourcesApi
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResourceListApiService ResourceListApi service
|
// ResourcesApiService ResourcesApi service
|
||||||
type ResourceListApiService service
|
type ResourcesApiService service
|
||||||
|
|
||||||
func (a *ResourceListApiService) OnlyOSS() ResourceListApi {
|
func (a *ResourcesApiService) OnlyOSS() ResourcesApi {
|
||||||
a.isOnlyOSS = true
|
a.isOnlyOSS = true
|
||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ResourceListApiService) OnlyCloud() ResourceListApi {
|
func (a *ResourcesApiService) OnlyCloud() ResourcesApi {
|
||||||
a.isOnlyCloud = true
|
a.isOnlyCloud = true
|
||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
type ApiGetResourcesRequest struct {
|
type ApiGetResourcesRequest struct {
|
||||||
ctx _context.Context
|
ctx _context.Context
|
||||||
ApiService ResourceListApi
|
ApiService ResourcesApi
|
||||||
zapTraceSpan *string
|
zapTraceSpan *string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ func (r ApiGetResourcesRequest) Execute() ([]string, error) {
|
|||||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
* @return ApiGetResourcesRequest
|
* @return ApiGetResourcesRequest
|
||||||
*/
|
*/
|
||||||
func (a *ResourceListApiService) GetResources(ctx _context.Context) ApiGetResourcesRequest {
|
func (a *ResourcesApiService) GetResources(ctx _context.Context) ApiGetResourcesRequest {
|
||||||
return ApiGetResourcesRequest{
|
return ApiGetResourcesRequest{
|
||||||
ApiService: a,
|
ApiService: a,
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
@ -96,7 +96,7 @@ func (a *ResourceListApiService) GetResources(ctx _context.Context) ApiGetResour
|
|||||||
* Execute executes the request
|
* Execute executes the request
|
||||||
* @return []string
|
* @return []string
|
||||||
*/
|
*/
|
||||||
func (a *ResourceListApiService) GetResourcesExecute(r ApiGetResourcesRequest) ([]string, error) {
|
func (a *ResourcesApiService) GetResourcesExecute(r ApiGetResourcesRequest) ([]string, error) {
|
||||||
var (
|
var (
|
||||||
localVarHTTPMethod = _nethttp.MethodGet
|
localVarHTTPMethod = _nethttp.MethodGet
|
||||||
localVarPostBody interface{}
|
localVarPostBody interface{}
|
||||||
@ -106,7 +106,7 @@ func (a *ResourceListApiService) GetResourcesExecute(r ApiGetResourcesRequest) (
|
|||||||
localVarReturnValue []string
|
localVarReturnValue []string
|
||||||
)
|
)
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ResourceListApiService.GetResources")
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ResourcesApiService.GetResources")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
|
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
|
||||||
}
|
}
|
@ -507,6 +507,7 @@ type ApiGetTasksRequest struct {
|
|||||||
orgID *string
|
orgID *string
|
||||||
status *string
|
status *string
|
||||||
limit *int32
|
limit *int32
|
||||||
|
type_ *string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r ApiGetTasksRequest) ZapTraceSpan(zapTraceSpan string) ApiGetTasksRequest {
|
func (r ApiGetTasksRequest) ZapTraceSpan(zapTraceSpan string) ApiGetTasksRequest {
|
||||||
@ -573,6 +574,14 @@ func (r ApiGetTasksRequest) GetLimit() *int32 {
|
|||||||
return r.limit
|
return r.limit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r ApiGetTasksRequest) Type_(type_ string) ApiGetTasksRequest {
|
||||||
|
r.type_ = &type_
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
func (r ApiGetTasksRequest) GetType_() *string {
|
||||||
|
return r.type_
|
||||||
|
}
|
||||||
|
|
||||||
func (r ApiGetTasksRequest) Execute() (Tasks, error) {
|
func (r ApiGetTasksRequest) Execute() (Tasks, error) {
|
||||||
return r.ApiService.GetTasksExecute(r)
|
return r.ApiService.GetTasksExecute(r)
|
||||||
}
|
}
|
||||||
@ -635,6 +644,9 @@ func (a *TasksApiService) GetTasksExecute(r ApiGetTasksRequest) (Tasks, error) {
|
|||||||
if r.limit != nil {
|
if r.limit != nil {
|
||||||
localVarQueryParams.Add("limit", parameterToString(*r.limit, ""))
|
localVarQueryParams.Add("limit", parameterToString(*r.limit, ""))
|
||||||
}
|
}
|
||||||
|
if r.type_ != nil {
|
||||||
|
localVarQueryParams.Add("type", parameterToString(*r.type_, ""))
|
||||||
|
}
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{}
|
localVarHTTPContentTypes := []string{}
|
||||||
|
|
||||||
|
@ -38,7 +38,9 @@ type WriteApi interface {
|
|||||||
- **InfluxDB URL** – _See [InfluxDB URLs]({{% INFLUXDB_DOCS_URL %}}/reference/urls/)_.
|
- **InfluxDB URL** – _See [InfluxDB URLs]({{% INFLUXDB_DOCS_URL %}}/reference/urls/)_.
|
||||||
- data in [line protocol]({{% INFLUXDB_DOCS_URL %}}/reference/syntax/line-protocol) format.
|
- data in [line protocol]({{% INFLUXDB_DOCS_URL %}}/reference/syntax/line-protocol) format.
|
||||||
|
|
||||||
For more information and examples, see [Write data with the InfluxDB API]({{% INFLUXDB_DOCS_URL %}}/write-data/developer-tools/api).
|
For more information and examples, see the following:
|
||||||
|
- [Write data with the InfluxDB API]({{% INFLUXDB_DOCS_URL %}}/write-data/developer-tools/api).
|
||||||
|
- [Optimize writes to InfluxDB]({{% INFLUXDB_DOCS_URL %}}/write-data/best-practices/optimize-writes/).
|
||||||
|
|
||||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
* @return ApiPostWriteRequest
|
* @return ApiPostWriteRequest
|
||||||
@ -186,7 +188,9 @@ To write data into InfluxDB, you need the following:
|
|||||||
- **InfluxDB URL** – _See [InfluxDB URLs]({{% INFLUXDB_DOCS_URL %}}/reference/urls/)_.
|
- **InfluxDB URL** – _See [InfluxDB URLs]({{% INFLUXDB_DOCS_URL %}}/reference/urls/)_.
|
||||||
- data in [line protocol]({{% INFLUXDB_DOCS_URL %}}/reference/syntax/line-protocol) format.
|
- data in [line protocol]({{% INFLUXDB_DOCS_URL %}}/reference/syntax/line-protocol) format.
|
||||||
|
|
||||||
For more information and examples, see [Write data with the InfluxDB API]({{% INFLUXDB_DOCS_URL %}}/write-data/developer-tools/api).
|
For more information and examples, see the following:
|
||||||
|
- [Write data with the InfluxDB API]({{% INFLUXDB_DOCS_URL %}}/write-data/developer-tools/api).
|
||||||
|
- [Optimize writes to InfluxDB]({{% INFLUXDB_DOCS_URL %}}/write-data/best-practices/optimize-writes/).
|
||||||
|
|
||||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
* @return ApiPostWriteRequest
|
* @return ApiPostWriteRequest
|
||||||
@ -348,6 +352,17 @@ func (a *WriteApiService) PostWriteExecute(r ApiPostWriteRequest) error {
|
|||||||
newErr.model = &v
|
newErr.model = &v
|
||||||
return newErr
|
return newErr
|
||||||
}
|
}
|
||||||
|
if localVarHTTPResponse.StatusCode == 500 {
|
||||||
|
var v Error
|
||||||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||||
|
if err != nil {
|
||||||
|
newErr.error = _fmt.Sprintf("%s: %s", newErr.Error(), err.Error())
|
||||||
|
return newErr
|
||||||
|
}
|
||||||
|
v.SetMessage(_fmt.Sprintf("%s: %s", newErr.Error(), v.GetMessage()))
|
||||||
|
newErr.model = &v
|
||||||
|
return newErr
|
||||||
|
}
|
||||||
var v Error
|
var v Error
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
openapi: 3.0.0
|
|
||||||
info:
|
|
||||||
title: Extra configuration to force openapi to generate enum validators
|
|
||||||
version: 2.0.0
|
|
||||||
servers: []
|
|
||||||
paths: {}
|
|
||||||
components:
|
|
||||||
schemas:
|
|
||||||
ResourceEnumOSS:
|
|
||||||
type: string
|
|
||||||
enum:
|
|
||||||
- authorizations
|
|
||||||
- buckets
|
|
||||||
- dashboards
|
|
||||||
- orgs
|
|
||||||
- sources
|
|
||||||
- tasks
|
|
||||||
- telegrafs
|
|
||||||
- users
|
|
||||||
- variables
|
|
||||||
- scrapers
|
|
||||||
- secrets
|
|
||||||
- labels
|
|
||||||
- views
|
|
||||||
- documents
|
|
||||||
- notificationRules
|
|
||||||
- notificationEndpoints
|
|
||||||
- checks
|
|
||||||
- dbrp
|
|
||||||
- notebooks
|
|
||||||
ResourceEnumCloud:
|
|
||||||
type: string
|
|
||||||
enum:
|
|
||||||
- authorizations
|
|
||||||
- buckets
|
|
||||||
- dashboards
|
|
||||||
- orgs
|
|
||||||
- tasks
|
|
||||||
- telegrafs
|
|
||||||
- users
|
|
||||||
- variables
|
|
||||||
- secrets
|
|
||||||
- labels
|
|
||||||
- views
|
|
||||||
- documents
|
|
||||||
- notificationRules
|
|
||||||
- notificationEndpoints
|
|
||||||
- checks
|
|
||||||
- dbrp
|
|
||||||
- flows
|
|
||||||
- annotations
|
|
||||||
- functions
|
|
@ -72,7 +72,7 @@ type APIClient struct {
|
|||||||
|
|
||||||
ReplicationsApi ReplicationsApi
|
ReplicationsApi ReplicationsApi
|
||||||
|
|
||||||
ResourceListApi ResourceListApi
|
ResourcesApi ResourcesApi
|
||||||
|
|
||||||
RestoreApi RestoreApi
|
RestoreApi RestoreApi
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ func NewAPIClient(cfg *Configuration) *APIClient {
|
|||||||
c.QueryApi = (*QueryApiService)(&c.common)
|
c.QueryApi = (*QueryApiService)(&c.common)
|
||||||
c.RemoteConnectionsApi = (*RemoteConnectionsApiService)(&c.common)
|
c.RemoteConnectionsApi = (*RemoteConnectionsApiService)(&c.common)
|
||||||
c.ReplicationsApi = (*ReplicationsApiService)(&c.common)
|
c.ReplicationsApi = (*ReplicationsApiService)(&c.common)
|
||||||
c.ResourceListApi = (*ResourceListApiService)(&c.common)
|
c.ResourcesApi = (*ResourcesApiService)(&c.common)
|
||||||
c.RestoreApi = (*RestoreApiService)(&c.common)
|
c.RestoreApi = (*RestoreApiService)(&c.common)
|
||||||
c.SecretsApi = (*SecretsApiService)(&c.common)
|
c.SecretsApi = (*SecretsApiService)(&c.common)
|
||||||
c.SetupApi = (*SetupApiService)(&c.common)
|
c.SetupApi = (*SetupApiService)(&c.common)
|
||||||
|
@ -12,7 +12,7 @@ paths:
|
|||||||
/setup:
|
/setup:
|
||||||
$ref: "./openapi/src/common/paths/setup.yml"
|
$ref: "./openapi/src/common/paths/setup.yml"
|
||||||
/write:
|
/write:
|
||||||
$ref: "./openapi/src/common/paths/write.yml"
|
$ref: "./openapi/src/oss/paths/write.yml"
|
||||||
/buckets:
|
/buckets:
|
||||||
$ref: "./openapi/src/common/paths/buckets.yml"
|
$ref: "./openapi/src/common/paths/buckets.yml"
|
||||||
/buckets/{bucketID}:
|
/buckets/{bucketID}:
|
||||||
|
Submodule api/contract/openapi updated: 588064fe68...7d9edc3299
@ -39,10 +39,13 @@ const (
|
|||||||
RESOURCEENUMOSS_CHECKS ResourceEnumOSS = "checks"
|
RESOURCEENUMOSS_CHECKS ResourceEnumOSS = "checks"
|
||||||
RESOURCEENUMOSS_DBRP ResourceEnumOSS = "dbrp"
|
RESOURCEENUMOSS_DBRP ResourceEnumOSS = "dbrp"
|
||||||
RESOURCEENUMOSS_NOTEBOOKS ResourceEnumOSS = "notebooks"
|
RESOURCEENUMOSS_NOTEBOOKS ResourceEnumOSS = "notebooks"
|
||||||
|
RESOURCEENUMOSS_ANNOTATIONS ResourceEnumOSS = "annotations"
|
||||||
|
RESOURCEENUMOSS_REMOTES ResourceEnumOSS = "remotes"
|
||||||
|
RESOURCEENUMOSS_REPLICATIONS ResourceEnumOSS = "replications"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ResourceEnumOSSValues() []ResourceEnumOSS {
|
func ResourceEnumOSSValues() []ResourceEnumOSS {
|
||||||
return []ResourceEnumOSS{"authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "notebooks"}
|
return []ResourceEnumOSS{"authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "notebooks", "annotations", "remotes", "replications"}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *ResourceEnumOSS) UnmarshalJSON(src []byte) error {
|
func (v *ResourceEnumOSS) UnmarshalJSON(src []byte) error {
|
||||||
@ -52,7 +55,7 @@ func (v *ResourceEnumOSS) UnmarshalJSON(src []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
enumTypeValue := ResourceEnumOSS(value)
|
enumTypeValue := ResourceEnumOSS(value)
|
||||||
for _, existing := range []ResourceEnumOSS{"authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "notebooks"} {
|
for _, existing := range []ResourceEnumOSS{"authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "notebooks", "annotations", "remotes", "replications"} {
|
||||||
if existing == enumTypeValue {
|
if existing == enumTypeValue {
|
||||||
*v = enumTypeValue
|
*v = enumTypeValue
|
||||||
return nil
|
return nil
|
||||||
|
@ -17,8 +17,12 @@ import (
|
|||||||
|
|
||||||
// MeasurementSchema The schema definition for a single measurement
|
// MeasurementSchema The schema definition for a single measurement
|
||||||
type MeasurementSchema struct {
|
type MeasurementSchema struct {
|
||||||
Id string `json:"id" yaml:"id"`
|
Id string `json:"id" yaml:"id"`
|
||||||
Name string `json:"name" yaml:"name"`
|
// ID of organization that the measurement schema is associated with.
|
||||||
|
OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"`
|
||||||
|
// ID of the bucket that the measurement schema is associated with.
|
||||||
|
BucketID *string `json:"bucketID,omitempty" yaml:"bucketID,omitempty"`
|
||||||
|
Name string `json:"name" yaml:"name"`
|
||||||
// An ordered collection of column definitions
|
// An ordered collection of column definitions
|
||||||
Columns []MeasurementSchemaColumn `json:"columns" yaml:"columns"`
|
Columns []MeasurementSchemaColumn `json:"columns" yaml:"columns"`
|
||||||
CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
|
CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
|
||||||
@ -71,6 +75,70 @@ func (o *MeasurementSchema) SetId(v string) {
|
|||||||
o.Id = v
|
o.Id = v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetOrgID returns the OrgID field value if set, zero value otherwise.
|
||||||
|
func (o *MeasurementSchema) GetOrgID() string {
|
||||||
|
if o == nil || o.OrgID == nil {
|
||||||
|
var ret string
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
return *o.OrgID
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetOrgIDOk returns a tuple with the OrgID field value if set, nil otherwise
|
||||||
|
// and a boolean to check if the value has been set.
|
||||||
|
func (o *MeasurementSchema) GetOrgIDOk() (*string, bool) {
|
||||||
|
if o == nil || o.OrgID == nil {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
return o.OrgID, true
|
||||||
|
}
|
||||||
|
|
||||||
|
// HasOrgID returns a boolean if a field has been set.
|
||||||
|
func (o *MeasurementSchema) HasOrgID() bool {
|
||||||
|
if o != nil && o.OrgID != nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOrgID gets a reference to the given string and assigns it to the OrgID field.
|
||||||
|
func (o *MeasurementSchema) SetOrgID(v string) {
|
||||||
|
o.OrgID = &v
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBucketID returns the BucketID field value if set, zero value otherwise.
|
||||||
|
func (o *MeasurementSchema) GetBucketID() string {
|
||||||
|
if o == nil || o.BucketID == nil {
|
||||||
|
var ret string
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
return *o.BucketID
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBucketIDOk returns a tuple with the BucketID field value if set, nil otherwise
|
||||||
|
// and a boolean to check if the value has been set.
|
||||||
|
func (o *MeasurementSchema) GetBucketIDOk() (*string, bool) {
|
||||||
|
if o == nil || o.BucketID == nil {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
return o.BucketID, true
|
||||||
|
}
|
||||||
|
|
||||||
|
// HasBucketID returns a boolean if a field has been set.
|
||||||
|
func (o *MeasurementSchema) HasBucketID() bool {
|
||||||
|
if o != nil && o.BucketID != nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBucketID gets a reference to the given string and assigns it to the BucketID field.
|
||||||
|
func (o *MeasurementSchema) SetBucketID(v string) {
|
||||||
|
o.BucketID = &v
|
||||||
|
}
|
||||||
|
|
||||||
// GetName returns the Name field value
|
// GetName returns the Name field value
|
||||||
func (o *MeasurementSchema) GetName() string {
|
func (o *MeasurementSchema) GetName() string {
|
||||||
if o == nil {
|
if o == nil {
|
||||||
@ -172,6 +240,12 @@ func (o MeasurementSchema) MarshalJSON() ([]byte, error) {
|
|||||||
if true {
|
if true {
|
||||||
toSerialize["id"] = o.Id
|
toSerialize["id"] = o.Id
|
||||||
}
|
}
|
||||||
|
if o.OrgID != nil {
|
||||||
|
toSerialize["orgID"] = o.OrgID
|
||||||
|
}
|
||||||
|
if o.BucketID != nil {
|
||||||
|
toSerialize["bucketID"] = o.BucketID
|
||||||
|
}
|
||||||
if true {
|
if true {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ type Client struct {
|
|||||||
api.AuthorizationsApi
|
api.AuthorizationsApi
|
||||||
api.UsersApi
|
api.UsersApi
|
||||||
api.OrganizationsApi
|
api.OrganizationsApi
|
||||||
api.ResourceListApi
|
api.ResourcesApi
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -395,7 +395,7 @@ func TestClient_RemoveMembers(t *testing.T) {
|
|||||||
|
|
||||||
req := api.ApiDeleteOrgsIDMembersIDRequest{ApiService: orgApi}.OrgID(id1.String()).UserID(id2.String())
|
req := api.ApiDeleteOrgsIDMembersIDRequest{ApiService: orgApi}.OrgID(id1.String()).UserID(id2.String())
|
||||||
orgApi.EXPECT().
|
orgApi.EXPECT().
|
||||||
DeleteOrgsIDMembersID(gomock.Any(), gomock.Eq(id2.String()), gomock.Eq(id1.String()), ).Return(req)
|
DeleteOrgsIDMembersID(gomock.Any(), gomock.Eq(id2.String()), gomock.Eq(id1.String())).Return(req)
|
||||||
orgApi.EXPECT().DeleteOrgsIDMembersIDExecute(gomock.Eq(req)).Return(nil)
|
orgApi.EXPECT().DeleteOrgsIDMembersIDExecute(gomock.Eq(req)).Return(nil)
|
||||||
},
|
},
|
||||||
expectedOut: "user \"2222222222222222\" has been removed from org \"1111111111111111\"",
|
expectedOut: "user \"2222222222222222\" has been removed from org \"1111111111111111\"",
|
||||||
|
@ -46,6 +46,16 @@ func helpText(perm string) struct{ readHelp, writeHelp string } {
|
|||||||
return help
|
return help
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func hidden(perm string) bool {
|
||||||
|
var hiddenTypes = map[string]struct{}{
|
||||||
|
"functions": {},
|
||||||
|
"remotes": {},
|
||||||
|
"replications": {},
|
||||||
|
}
|
||||||
|
_, ok := hiddenTypes[perm]
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
func newCreateCommand() cli.Command {
|
func newCreateCommand() cli.Command {
|
||||||
var params auth.CreateParams
|
var params auth.CreateParams
|
||||||
flags := append(commonFlags(), getOrgFlags(¶ms.OrgParams)...)
|
flags := append(commonFlags(), getOrgFlags(¶ms.OrgParams)...)
|
||||||
@ -96,11 +106,13 @@ func newCreateCommand() cli.Command {
|
|||||||
Name: "read-" + perm.Name,
|
Name: "read-" + perm.Name,
|
||||||
Usage: help.readHelp + ossVsCloud,
|
Usage: help.readHelp + ossVsCloud,
|
||||||
Destination: &perm.Read,
|
Destination: &perm.Read,
|
||||||
|
Hidden: hidden(perm.Name),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "write-" + perm.Name,
|
Name: "write-" + perm.Name,
|
||||||
Usage: help.writeHelp + ossVsCloud,
|
Usage: help.writeHelp + ossVsCloud,
|
||||||
Destination: &perm.Write,
|
Destination: &perm.Write,
|
||||||
|
Hidden: hidden(perm.Name),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +131,7 @@ func newCreateCommand() cli.Command {
|
|||||||
AuthorizationsApi: api.AuthorizationsApi,
|
AuthorizationsApi: api.AuthorizationsApi,
|
||||||
UsersApi: api.UsersApi,
|
UsersApi: api.UsersApi,
|
||||||
OrganizationsApi: api.OrganizationsApi,
|
OrganizationsApi: api.OrganizationsApi,
|
||||||
ResourceListApi: api.ResourceListApi,
|
ResourcesApi: api.ResourcesApi,
|
||||||
}
|
}
|
||||||
return client.Create(getContext(ctx), ¶ms)
|
return client.Create(getContext(ctx), ¶ms)
|
||||||
},
|
},
|
||||||
|
@ -11,10 +11,11 @@
|
|||||||
package backup_restore
|
package backup_restore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
sync "sync"
|
sync "sync"
|
||||||
|
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Reference in New Issue
Block a user