ccictl create
Scenario
Create a resource based on a file or stdin.
Both JSON and YAML are supported.
ccictl create -f FILENAME
Examples
# Use the data in pod.json to create a pod. ccictl create -f ./pod.json # Create a pod based on stdin in the JSON format. cat pod.json | ccictl create -f - # Edit the data in registry.yaml in JSON format and use the edited data to create resources. ccictl create -f registry.yaml --edit -o json
Options
--allow-missing-template-keys Default: true
If the value is true, the error in the template is ignored when a field or mapping key is missing in the template. This option applies only to the Golang and JSONPath output formats.
--edit
Edit API resources before creating a resource.
-f, --filename strings
File name, directory, or file URL used to create a resource
-h, --help
Help information for create
-o, --output string
Output format. The value options include json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, and jsonpath-file.
--raw string
Original URI used to send a POST request to the server. Use the transfer mode specified in the cliconfig file.
-R, --recursive
Process the directory used in -f or --filename recursively. This option is useful when you want to manage related manifests organized within the same directory.
--save-config
If the value is true, the configuration of the object is saved in its annotation. Otherwise, the annotation remains unchanged. This flag is useful when you want to run the ccictl apply command on the object.
-l, --selector string
Selector used for filtering (label query). The value can be =, ==, or !=, for example, -l key1=value1,key2=value2. Matched objects must meet all specified label constraints.
--template string
Template character string or template file path used when -o is set to go-template or go-template-file. The Golang template format is [http://golang.org/pkg/text/template/#pkg-overview].
--validate string[="strict"] Default: "strict"
The value must be one of the following: "strict" (or "true"), "warn", and "ignore" (or "false"). "true" or "strict" will use the pattern definition to validate the input. If the input is invalid, the request fails.
"false" or "ignore" will not perform any schema definition checks, but will silently delete all unknown or duplicate fields.
--windows-line-endings
This option is related only when --edit is set to true. The default value is the native line end format of your platform.
The following ccictl options can also be used in subcommands:
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot