Managing profile parameters
You can manage your profile parameters in the following ways:
- Add or change a profile parameter.
- Delete a profile parameter.
- Run a command with parameters from another profile.
Add or change a profile parameter
To add or change a profile parameter, use the command:
yc config set <parameter_name> <parameter_value>
For example, change the default folder:
-
Change the default folder (the
folder-idparameter):yc config set folder-id b1g5bhjofg7o******** -
Link an organization to a profile:
yc config set organization-id bpfaidqca8vd******** -
Make sure the parameters have actually changed:
yc config listResult:
subject-id: ajea53egl28l******** cloud-id: b1gj9ja2h4ct******** folder-id: b1g5bhjofg7o******** organization-id: bpfaidqca8vd********
Note
In the CLI, you have access to the default folder resources. If you often use resources residing in a particular folder, make it your default folder so you do not have to specify --folder-id or --folder-name each time. When using the resource ID, there is no need to specify the folder.
View the full list of profile parameters. You can also change your profile parameters using the profile wizard.
Delete a profile parameter
To delete a profile parameter, use the command:
yc config unset <parameter_name>
For example, unlink the default organization from a profile:
-
Unlink the default organization (the
organization-idparameter):yc config unset organization-id -
Make sure the parameter has been actually deleted:
yc config listResult:
subject-id: ajea53egl28l******** cloud-id: b1gj9ja2h4ct******** folder-id: b1g5bhjofg7o********
Run a command with parameters from another profile
To run the command with the parameters of a different profile, add the --profile <profile_name> parameter to the command.
For example, view the test profile parameters without activating it:
yc config list --profile test
Result:
subject-id: ajea53egl28l********
cloud-id: b15jlj22h4ct********
folder-id: b1grb2jo7g7o********