(s *schema.Schema)
| 124 | } |
| 125 | |
| 126 | func (gohanClientCLI *GohanClientCLI) getPostCommand(s *schema.Schema) gohanCommand { |
| 127 | return gohanCommand{ |
| 128 | Name: fmt.Sprintf("%s create", s.ID), |
| 129 | Schema: s, |
| 130 | Action: func(args []string) (string, error) { |
| 131 | argsMap, err := gohanClientCLI.handleArguments(args, s) |
| 132 | if err != nil { |
| 133 | return "", err |
| 134 | } |
| 135 | parsedArgs, err := gohanClientCLI.handleRelationArguments(s, argsMap) |
| 136 | if err != nil { |
| 137 | return "", err |
| 138 | } |
| 139 | opts := gophercloud.RequestOpts{ |
| 140 | JSONBody: parsedArgs, |
| 141 | OkCodes: []int{201, 202, 400}, |
| 142 | } |
| 143 | url := fmt.Sprintf("%s%s", gohanClientCLI.opts.gohanEndpointURL, s.URL) |
| 144 | result, err := gohanClientCLI.request("POST", url, &opts) |
| 145 | return gohanClientCLI.formatOutput(s, result), err |
| 146 | }, |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | func (gohanClientCLI *GohanClientCLI) getPutCommand(s *schema.Schema) gohanCommand { |
| 151 | return gohanCommand{ |
no test coverage detected