fix: deprecated add endpoint and variable declaration

This commit is contained in:
Stefan Benz 2022-10-07 14:01:06 +02:00
parent 9cbe4650d8
commit d92caaf07d
No known key found for this signature in database
GPG Key ID: 9D2FE4EA50BEFE68
4 changed files with 10 additions and 7 deletions

View File

@ -49,7 +49,7 @@ Returns the detail of an instance
> **rpc** AddInstance([AddInstanceRequest](#addinstancerequest))
[AddInstanceResponse](#addinstanceresponse)
Creates a new instance with all needed setup data
deprecated: Creates a new instance with all needed setup data
This might take some time
@ -74,7 +74,8 @@ Updates name of an existing instance
> **rpc** CreateInstance([CreateInstanceRequest](#createinstancerequest))
[CreateInstanceResponse](#createinstanceresponse)
Creates a new instance with all needed setup data
This might take some time

View File

@ -386,8 +386,8 @@ func (c *Commands) SetUpInstance(ctx context.Context, setup *InstanceSetup) (str
return "", "", nil, nil, err
}
pat := ""
machineKey := make([]byte, 0)
var pat string
var machineKey []byte
if setup.Org.Machine != nil {
if setup.Org.Machine.Pat {
_, token, err := c.AddPersonalAccessToken(ctx, userID, orgID, setup.Org.Machine.PatExpirationDate, setup.Org.Machine.PatScopes, domain.UserTypeMachine)

View File

@ -70,8 +70,8 @@ func (c *Commands) setUpOrgWithIDs(ctx context.Context, o *OrgSetup, orgID, user
return "", "", nil, nil, err
}
pat := ""
machineKey := make([]byte, 0)
var pat string
var machineKey []byte
if o.Machine != nil {
if o.Machine.Pat {
_, token, err := c.AddPersonalAccessToken(ctx, userID, orgID, o.Machine.PatExpirationDate, o.Machine.PatScopes, domain.UserTypeMachine)

View File

@ -122,7 +122,7 @@ service SystemService {
};
}
// Creates a new instance with all needed setup data
//deprecated: Creates a new instance with all needed setup data
// This might take some time
rpc AddInstance(AddInstanceRequest) returns (AddInstanceResponse) {
option (google.api.http) = {
@ -147,6 +147,8 @@ service SystemService {
};
}
// Creates a new instance with all needed setup data
// This might take some time
rpc CreateInstance(CreateInstanceRequest) returns (CreateInstanceResponse) {
option (google.api.http) = {
post: "/instances/_create"