Add handler and API support for alias creation with target (#4508)
* Add handler and API support for alias creation with target
This commit is contained in:
15 files changed
+1116
-484
No files matched your search
@@ -5,6 +5,8 @@
|
||||
package targets
|
||||
|
||||
type Alias struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
Value string `json:"value,omitempty"`
|
||||
Id string `json:"id,omitempty"`
|
||||
Value string `json:"value,omitempty"`
|
||||
ScopeId string `json:"scope_id,omitempty"`
|
||||
Attributes *TargetAliasAttributes `json:"attributes,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Code generated by "make api"; DO NOT EDIT.
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package targets
|
||||
|
||||
type AuthorizeSessionArguments struct {
|
||||
HostId string `json:"host_id,omitempty"`
|
||||
}
|
||||
@@ -115,6 +115,12 @@ func DefaultAddress() Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithAliases(inAliases []Alias) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["with_aliases"] = inAliases
|
||||
}
|
||||
}
|
||||
|
||||
func WithAttributes(inAttributes map[string]interface{}) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["attributes"] = inAttributes
|
||||
|
||||
@@ -42,6 +42,7 @@ type Target struct {
|
||||
AuthorizedActions []string `json:"authorized_actions,omitempty"`
|
||||
Address string `json:"address,omitempty"`
|
||||
Aliases []*Alias `json:"aliases,omitempty"`
|
||||
WithAliases []*Alias `json:"with_aliases,omitempty"`
|
||||
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// Code generated by "make api"; DO NOT EDIT.
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package targets
|
||||
|
||||
type TargetAliasAttributes struct {
|
||||
AuthorizeSessionArguments *AuthorizeSessionArguments `json:"authorize_session_arguments,omitempty"`
|
||||
}
|
||||
Reference in new issue
Block a user