File tree Expand file tree Collapse file tree
cmd/ctrlc/root/api/upsert Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ func NewUpsertPolicyCmd() *cobra.Command {
9999 }
100100
101101 // Create policy request
102- body := api.CreatePolicyJSONRequestBody {
102+ body := api.UpsertPolicyJSONRequestBody {
103103 Name : name ,
104104 WorkspaceId : workspaceId ,
105105 Description : & description ,
@@ -115,7 +115,7 @@ func NewUpsertPolicyCmd() *cobra.Command {
115115 DeploymentVersionSelector : parsedDeploymentVersionSelector ,
116116 }
117117
118- resp , err := client .CreatePolicy (cmd .Context (), body )
118+ resp , err := client .UpsertPolicy (cmd .Context (), body )
119119 if err != nil {
120120 return fmt .Errorf ("failed to create policy: %w" , err )
121121 }
Original file line number Diff line number Diff line change @@ -70,27 +70,14 @@ func NewUpsertResourceCmd() *cobra.Command {
7070 }
7171
7272 // Extrat into vars
73- resp , err := client .UpsertResources (cmd .Context (), api.UpsertResourcesJSONRequestBody {
74- Resources : []struct {
75- Config map [string ]interface {} `json:"config"`
76- Identifier string `json:"identifier"`
77- Kind string `json:"kind"`
78- Metadata * map [string ]string `json:"metadata,omitempty"`
79- Name string `json:"name"`
80- Variables * []api.Variable `json:"variables,omitempty"`
81- Version string `json:"version"`
82- }{
83- {
84- Version : version ,
85- Identifier : identifier ,
86- Metadata : & metadata ,
87- Name : name ,
88- Kind : kind ,
89- Config : config ,
90- Variables : variablesRequest ,
91- },
92- },
93-
73+ resp , err := client .UpsertResource (cmd .Context (), api.UpsertResourceJSONRequestBody {
74+ Config : config ,
75+ Identifier : identifier ,
76+ Kind : kind ,
77+ Metadata : & metadata ,
78+ Name : name ,
79+ Variables : variablesRequest ,
80+ Version : version ,
9481 WorkspaceId : uuid .Must (uuid .Parse (workspaceId )),
9582 })
9683
You can’t perform that action at this time.
0 commit comments