Metadata Access (IOMI Interface) |
Deletes metadata objects from a repository.
Category: Write methods
Syntax |
rc=DeleteMetadata(inMetadata,outMetadata,ns,flags,options);
Parameters |
Parameter | Type | Direction | Description |
---|---|---|---|
rc | N | out | Return code for the method. For more information, see Return Code. |
inMetadata | C | in | Metadata property string that identifies the object to be deleted. |
outMetadata | C | out | Returned metadata property string that includes the results of the delete operation. The outMetadata parameter is used only if OMI_RETURN_LIST is specified. |
ns | C | in | Namespace to use as the context for the request. |
flags | L | in |
|
options | C | in |
Passed indicator for options.
|
Details |
The DeleteMetadata method deletes metadata objects from a repository. To replace or modify the properties of a metadata object, use the UpdateMetadata method.
The DeleteMetadata method is typically issued in the SAS namespace to delete metadata representing application elements. However, it can be issued in the REPOS namespace on a RepositoryBase object to unregister the repository, to destroy the repository, or to clear all objects from the repository without harming the repository's registration. Flags that are valid only in the REPOS namespace are provided to perform these tasks. For more information, see Deleting a Repository. You must have administrative status on the SAS Metadata Server to issue the DeleteMetadata method in the REPOS namespace. For more information about administrative user status, see the SAS Intelligence Platform: Security Administration Guide.
Regardless of the namespace in which it is issued (REPOS or SAS), a DeleteMetadata method call must set the OMI_TRUSTED_CLIENT flag (268435456). The OMI_TRUSTED_CLIENT flag is required in all method calls that write or remove metadata.
The object to delete is primarily identified in a metadata property string that is submitted to the method in the INMETADATA parameter. To delete multiple objects, stack their metadata property strings in the INMETADATA parameter.
In SAS 9.2, a DeleteMetadata method issued in the SAS namespace deletes the specified object and associated objects that are specified in a template when the OMI_TEMPLATE flag is set. A template is submitted in a <TEMPLATE> element within the <TEMPLATES> element. The use of a <TEMPLATE> element within the <TEMPLATES> element is unique to DeleteMetadata. It is supported to enable multiple objects and their associated objects to be deleted by the DeleteMetadata method.
For usage information about deleting SAS namespace metadata objects, see Deleting Metadata Objects.
Check the return code of a DeleteMetadata method call. A nonzero return code indicates that a failure occurred while trying to delete the metadata objects. A nonzero return code means none of the changes indicated by the method call were made.
Example 1: Standard Interface |
The following is an example of how to issue the DeleteMetadata method regardless of the programming environment. The request deletes a SASLibrary object. When a SASLibrary object is deleted, any object in the library is deleted as well. The OMI_RETURN_LIST flag is specified (268435456 + 1024 =268436480) so the OUTMETADATA parameter returns the identifiers of all deleted objects.
inMetadata="<SASLibrary Id='A2345678.A2000001'/>"; outMetadata=""; ns= "SAS"; flags= 268436480; options= ""; rc = DeleteMetadata(inMetadata, outMetadata, ns, flags, options);
Example 2: DoRequest Method |
The following is an example of an XML string that shows how to format the method call in example 1 for the INMETADATA parameter of the DoRequest method.
<!-- XML string for inMetadata= parameter of DoRequest method call --> <DeleteMetadata> <Metadata> <SASLibrary Id="A2345678.A2000001"/> </Metadata> <NS>SAS</NS> <Flags>268436480</Flags> <Options/> </DeleteMetadata>
Related Methods |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.