Share via


Secrets - Create Or Update

Creates or updates a Secret with the specified subscription, resource group and resource name.
The operation returns properties of a Secret.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openshiftclusters/{resourceName}/secret/{childResourceName}?api-version=2023-11-22

URI Parameters

Name In Required Type Description
childResourceName
path True

string

minLength: 1
maxLength: 63
pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]*[a-zA-Z0-9]$

The name of the Secret resource.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

resourceName
path True

string

minLength: 1
maxLength: 63
pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]*[a-zA-Z0-9]$

The name of the OpenShift cluster resource.

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Type Description
properties.secretResources

string

The Secrets Resources.

Responses

Name Type Description
200 OK

Secret

OK

201 Created

Secret

Created

Other Status Codes

CloudError

Error response describing why the operation failed. If any of the input parameters is wrong, 400 (Bad Request) is returned.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Creates or updates a Secret with the specified subscription, resource group and resource name.

Sample request

PUT https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/openshiftclusters/resourceName/secret/childResourceName?api-version=2023-11-22

{
  "properties": {}
}

Sample response

{
  "id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/secret/mySecret",
  "name": "mySecret",
  "type": "Microsoft.RedHatOpenShift/OpenShiftClusters/Secrets",
  "properties": {}
}
{
  "id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.RedHatOpenShift/OpenShiftClusters/resourceName/secret/mySecret",
  "name": "mySecret",
  "type": "Microsoft.RedHatOpenShift/OpenShiftClusters/Secrets",
  "properties": {}
}

Definitions

Name Description
CloudError

CloudError represents a cloud error.

CloudErrorBody

CloudErrorBody represents the body of a cloud error.

createdByType

The type of identity that created the resource.

Secret

Secret represents a secret.

systemData

Metadata pertaining to creation and last modification of the resource.

CloudError

CloudError represents a cloud error.

Name Type Description
error

CloudErrorBody

An error response from the service.

CloudErrorBody

CloudErrorBody represents the body of a cloud error.

Name Type Description
code

string

An identifier for the error. Codes are invariant and are intended to be consumed programmatically.

details

CloudErrorBody[]

A list of additional details about the error.

message

string

A message describing the error, intended to be suitable for display in a user interface.

target

string

The target of the particular error. For example, the name of the property in error.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

Secret

Secret represents a secret.

Name Type Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

The name of the resource

properties.secretResources

string

The Secrets Resources.

systemData

systemData

The system meta data relating to this resource.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.