Using GetMetadataObjects to Get All Metadata of a Specified Metadata Type |
The GetMetadataObjects method supports the OMI_DEPENDENCY_USES (8192) and OMI_DEPENDENCY_USED_BY (16384) flags to enable you to get objects from other repositories.
The behavior of these flags has changed between SAS 9.1.3 and SAS 9.2. In SAS 9.1.3, the flags specified to include objects from repositories that existed either above or below the specified repository in the repository chain. In SAS 9.2, their behavior is much simpler and is as follows:
Set OMI_DEPENDENCY_USES to include objects from all public repositories in the method results. The foundation repository and all custom repositories are public repositories.
Set OMI_DEPENDENCY_USED_BY to include objects from all private repositories in the method results. Project repositories are considered to be private repositories.
To get objects from all repositories on the SAS Metadata Server, set both flags.
See the following topics for examples of how the flags are used:
Example of a GetMetadataObjects Request That Includes All Public Repositories
Example of a GetMetadataObjects Request That Includes All Project Repositories
Example of a GetMetadataObjects Request That Includes All Repositories
Example of a GetMetadataObjects Request That Includes All Public Repositories |
The following is an example of a GetMetadataObjects request that sets the OMI_DEPENDENCY_USES (8192) flag:
<GetMetadataObjects> <!-- Reposid parameter specifies host repository --> <Reposid>A0000001.A53TPPVI</Reposid> <Type>PhysicalTable</Type> <Objects/> <NS>SAS</NS> <!-- Specify OMI_DEPENDENCY_USES (8192) flag --> <Flags>8192</Flags> <Options/> </GetMetadataObjects>
This request returns all objects of the PhysicalTable metadata type from the specified repository and all other public repositories.
In the request, note the following:
The <REPOSID> element specifies a repository to search. When the OMI_DEPENDENCY_USES flag is set, specifying a value for the <REPOSID> element is optional. When a <REPOSID> value is omitted, the method gets objects of the specified metadata type first from the foundation repository, and then second from all custom repositories in the order that they were registered.
When a repository identifier is specified in the <REPOSID> element, the SAS Metadata Server gets objects from the specified repository first, before it gets objects from the foundation repository and custom repositories. The specified repository can be the foundation repository, a custom repository, or a project repository.
The <TYPE> element specifies the metadata type of the objects to list.
The OMI_DEPENDENCY_USES flag is expressed as a numeric value in the <FLAGS> element.
Output is returned in the <OBJECTS> element.
Example of a GetMetadataObjects Request That Includes All Project Repositories |
A GetMetadataObjects request can be expanded to include objects from all project repositories by setting the OMI_DEPENDENCY_USED_BY (16384) flag. The following is an example of a GetMetadataObjects request that sets the OMI_DEPENDENCY_USED_BY (16384) flag:
<GetMetadataObjects> <!-- Reposid parameter specifies host repository --> <Reposid>A0000001.A53TPPVI</Reposid> <Type>PhysicalTable</Type> <Objects/> <NS>SAS</NS> <!-- Specify OMI_DEPENDENCY_USED_BY (16384) flag --> <Flags>16384</Flags> <Options/> </GetMetadataObjects>
In the request, note the following:
The <REPOSID> element specifies a repository to search. When the OMI_DEPENDENCY_USED_BY flag is set, specifying a value for the <REPOSID> element is optional. When is <REPOSID> value is omitted, the method gets objects of the specified metadata type from all project repositories in the order that the repositories were registered. When a repository identifier is specified in the <REPOSID> element, the SAS Metadata Server gets objects from the specified repository first, and then gets objects from the project repositories. The specified repository can be the foundation repository, a custom repository, or a project repository.
The <TYPE> element specifies the metadata type of the objects to list.
The OMI_DEPENDENCY_USED_BY flag is expressed as a numeric value in the <FLAGS> element.
Output is returned in the <OBJECTS> element.
Example of a GetMetadataObjects Request That Includes All Repositories |
To get objects from all repositories that are registered on the SAS Metadata Server (foundation, custom, and project), set both the OMI_DEPENDENCY_USES (8192) and OMI_DEPENDENCY_USED_BY (16384) flags.
The following is an example of a GetMetadataObjects request that gets objects of metadata type PhysicalTable from all repositories:
<GetMetadataObjects> <!-- Reposid parameter specifies host repository --> <Reposid></Reposid> <Type>PhysicalTable</Type> <Objects/> <NS>SAS</NS> <!-- Specify OMI_DEPENDENCY_USES (8192) and OMI_DEPENDENCY_USED_BY (16384) flags --> <Flags>24576</Flags> <Options/> </GetMetadataObjects>
In the request, note the following:
It is not necessary to specify a target repository in the <REPOSID> element. When the <REPOSID> element is blank, the method gets objects from all repositories, beginning with the foundation repository, then custom repositories, and then project repositories. Within each category, the repositories are listed in the order that they were registered. When a repository identifier is specified in the <REPOSID> parameter, the SAS Metadata Server gets objects from that repository before it gets objects from other repositories. The specified repository can be the foundation repository, a custom repository, or a project repository.
The <TYPE> element specifies the metadata type of the objects to list.
The <FLAGS> element specifies the sum of the numeric values representing the OMI_DEPENDENCY_USES and OMI_DEPENDENCY_USED_BY flags (8192 + 16384 = 24576).
Output is returned in the <OBJECTS> element.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.