Creates or edits an Kubernetesplugin publication profile.
- Endpoint:
/api/certificate/profile/kubernetes
- Method:
POST
- Request:
POST /api/certificate/profile/kubernetes
Request parameters
| Field |
Type |
Required |
Description |
code_profile |
int |
No |
The code of an already created profile. If not provided, the system will interpret it as the creation of a new profile. |
name_profile |
string |
Yes |
The name of the profile to be created. |
code_credential |
int |
Conditional |
The credential code to be used for the publication. A previously registered credential will be used. This is required if no username is provided. |
username |
string |
Conditional |
The username to locate credentials for the publication. Required if no code_credential is provided. |
devices |
array |
Yes |
Array with the codes of the devices where the certificate should be published. |
secrets |
array |
No |
Array of objects with names and namespaces of the secrets to be created or updated in the respective namespaces. Each item must have a name and namespace. |
auto_redeploy |
array |
No |
The system contains an array of automatic redeploy objects. Each object must specify a valid Kubernetes resource_type along with name and namespace. |
Example using cURL
curl -X POST \
https://[segura_vault_url]/api/certificate/profile/kubernetes \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [seu-token]' \
-d '{
"name_profile": "teste",
"code_credential": 1,
"devices": [1],
"secrets": [
{
"name": "teste",
"namespace": "teste"
}
],
"auto_redeploy": [
{
"resource_type": "Deployment",
"name": "teste",
"namespace": "teste"
}
]
}
Response
{
"name_profile": "teste",
"code_credential": 1,
"devices": [
1
],
"secrets": [
{
"name": "teste",
"namespace": "teste"
}
],
"auto_redeploy": [
{
"resource_type": "Deployment",
"name": "teste",
"namespace": "teste"
}
]
}
Error responses
| HTTP Status Code |
Description |
| 400 Bad Request |
Invalid parameters provided. |
| 401 Unauthorized |
Unauthorized access. |
| 403 Forbidden |
Forbidden access. |
| 404 Not Found |
Resource not found. |
| 500 Internal Server Error |
Internal server error. |