4.5 Application Label Management Commands

Use the commands in Table 4-5 to manage labels for applications.


Table 4-5 Application Label Management Commands

Use this command... To... Use with WLST...

createMetadataLabel

Creates a metadata label.

Online

deleteMetadataLabel

Deletes a metadata label from the repository partition.

Online

listMetadataLabels

Lists metadata labels in the repository partition.

Online

promoteMetadataLabel

Promotes the metadata associated with a label to tip.

Online

purgeMetadataLabels

Deletes the labels matching the specified criteria.

Online


4.5.1 createMetadataLabel

Command Category: Application Label Management

Use with WLST: Online

Description

Creates a new label for the documents in the application's repository partition. This command is applicable only for repositories that support versioning.

Syntax

createMetadataLabel(application, server, name [, applicationVersion] [, tenantName])

Argument Definition
application

The name of the application for which a label will be created in the partition configured for this application.

server

The target server on which this application is deployed. If the application is deployed to multiple Managed Servers in a cluster, you can use the name of any of the server names. You cannot specify multiple server names.

name

The name of the label to create in the repository partition.

applicationVersion

Optional. The application version, if multiple versions of the same application are deployed.

tenantName

A unique name identifying the tenant to use for this operation. This argument is required for a multitenant application and is not applicable for a non-multitenant application. For a non-multitenant application, any specified value will be ignored.


Example

The following example creates the label label1 for the application mdsapp deployed in the server server1:

wls:/weblogic/serverConfig> createMetadataLabel('mdsapp','server1','label1')
Executing operation: createMetadataLabel.
Created metadata label "label1".

4.5.2 deleteMetadataLabel

Command Category: Application Label Management

Use with WLST: Online

Description

Deletes a label for the documents in the application's repository partition. This command is applicable only for repositories that support versioning.

Syntax

deleteMetadataLabel(application, server, name [, applicationVersion] [, tenantName])

Argument Definition
application

The name of the application from whose associated partition the label is to be deleted.

server

The target server on which this application is deployed. If the application is deployed to multiple Managed Servers in a cluster, you can use the name of any of the server names. You cannot specify multiple server names.

name

The name of the label to delete in the repository partition.

applicationVersion

Optional. The application version, if multiple versions of the same application are deployed.

tenantName

A unique name identifying the tenant to use for this operation. This argument is required for a multitenant application and is not applicable for a non-multitenant application. For a non-multitenant application, any specified value will be ignored.


Example

The following example deletes the metadata label label1 from the application mdsapp deployed in the server server1:

wls:/weblogic/serverConfig> deleteMetadataLabel('mdsapp','server1','label1')
Executing operation: deleteMetadataLabel.
Deleted metadata label "label1".

4.5.3 listMetadataLabels

Command Category:

Use with WLST: Online

Description

Lists all of the metadata labels in the application's repository partition. This command is applicable only for repositories that support versioning.

Syntax

listMetadataLabels(application, server [, applicationVersion] [, tenantName])

Argument Definition
application

The name of the application for which all of the labels in the repository partition should be listed.

server

The target server on which this application is deployed. If the application is deployed to multiple Managed Servers in a cluster, you can use the name of any of the server names. You cannot specify multiple server names.

applicationVersion

Optional. The application version, if multiple versions of the same application are deployed.

tenantName

A unique name identifying the tenant to use for this operation. This argument is required for a multitenant application and is not applicable for a non-multitenant application. For a non-multitenant application, any specified value will be ignored.


Example

The following example lists the metadata labels available for the application mdsapp deployed in the server server1:

wls:/weblogic/serverConfig> listMetadataLabels('mdsapp', 'server1')
Executing operation: listMetadataLabels.
Database Repository partition contains the following labels:
label2
label3

4.5.4 promoteMetadataLabel

Command Category: Application Label Management

Use with WLST: Online

Description

Promotes documents associated with a label to the tip version in the repository. This command is useful to achieve rollback capability. This command is applicable only for repositories that support versioning.

Syntax

promoteMetadataLabel(application, server, name [, applicationVersion] [, tenantName])

Argument Definition
application

The name of the application in whose associated repository the metadata is to be promoted to tip.

server

The target server on which this application is deployed. If the application is deployed to multiple Managed Servers in a cluster, you can use the name of any of the server names. You cannot specify multiple server names.

name

The name of the label to promote in the repository partition.

applicationVersion

Optional. The application version, if multiple versions of the same application are deployed.

tenantName

A unique name identifying the tenant to use for this operation. This argument is required for a multitenant application and is not applicable for a non-multitenant application. For a non-multitenant application, any specified value will be ignored.


Example

The following example promotes the metadata label label1 to tip in the application mdsapp deployed in the server server1:

wls:/weblogic/serverConfig> promoteMetadataLabel('mdsapp', 'server1','label1')
Executing operation: promoteMetadataLabel.
Promoted metadata label "label1" to tip.

4.5.5 purgeMetadataLabels

Command Category: Application Label Management

Use with WLST: Online

Description

Purges or lists the metadata labels that match the given pattern or age, but does not delete the metadata documents that were part of the label. You can delete the documents by executing the purgeMetadata command.

Syntax

purgeMetadataLabels(repository, partition [, namePattern] [, olderThanInMin] 
 [, infoOnly] [, tenantName])

Argument Definition
repository

The name of the MDS repository that contains the partition whose metadata labels will be purged or listed.

partition

The name of the partition whose metadata labels will be purged or listed.

namePattern

Optional. A pattern that matches the names of labels. If you do not specify this argument, all labels in the partition are purged.

See "Common Name Pattern Format" for information about the patterns that you can use with this argument.

olderThanInMin

Optional. The age of the labels, in minutes. The default is 525600 (one year).

infoOnly

Optional. Valid values are true or false. If you set it to true, it does not purge the labels, but lists the labels that match the specified pattern.

The default is false.

tenantName

A unique name identifying the tenant to use for this operation. This argument is required for a multitenant application and is not applicable for a non-multitenant application. For a non-multitenant application, any specified value will be ignored.


Examples

The following example lists the labels that match the specified namePattern, but does not delete them:

wls:/weblogic/serverConfig> purgeMetadataLabels(repository='mds-myRepos',
           partition='partition1', namePattern='mylabel*', infoOnly='true' )

The following example purges the labels that match the specified namePattern and that are older than a year:

wls:/weblogic/serverConfig> purgeMetadataLabels(repository='mds-myRepos',
                    partition='partition1', namePattern='mylabel*')

The following example deletes labels that match the specified namePattern and that are older than 30 minutes:

wls:/weblogic/serverConfig> purgeMetadataLabels(repository='mds-myRepos',
                   partition='partition1', 
                  namePattern='mylabel*', olderThanInMin='30')