GetRepositories

Short Description

Gets the metadata repositories on the SAS Metadata Server.

Category

Repository methods

Syntax

rc=GetRepositories(repositories,flags,options);

Parameters

Method Parameters
Parameter
Type
Direction
Description
rc
N
out
Return code for the method. For more information, see Return Code.
repositories
C
out
Returned list of all repositories that are registered on the SAS Metadata Server.
flags
L
in
OMI_ALL=1
Gets information about repository location, format, type and availability in addition to listing repositories.
options
C
in
Passed indicator for options. No options are currently defined.

Details

A repository is a collection of related metadata objects. Each repository is registered in the SAS Repository Manager, which is also a SAS Metadata Repository. The SAS Metadata Server can access only those repositories that are registered in the SAS Repository Manager. There is one SAS Repository Manager for a SAS Metadata Server.
By default, the GetRepositories method gets Identifying Metadata, the description, and the default namespace for the SAS Repository Manager and each repository that is registered in the SAS Repository Manager.
When issued with the OMI_ALL (1) flag set, the GetRepositories method also gets the following attributes for each repository:
Path= “string
the pathname of the physical directory where the repository is located.
RepositoryFormat= “number
a numeric double value indicating the format level of the repository. (For example, 11.0.)
RepositoryType= “FOUNDATION | CUSTOM | PROJECT”
the repository type.
Access= “OMS_FULL | OMS_READONLY | OMS_ADMIN | OMS_OFFLINE”
a descriptor that indicates the access mode that the administrator set for the repository.
OMS_FULL
Specifies the repository is available to all users for Read and Write access.
OMS_READONLY
Specifies the repository is only to be read.
OMS_ADMIN
Specifies the repository is available only to users who have administrative status on the SAS Metadata Server.
OMS_OFFLINE
Specifies the repository is unavailable to all users.
PauseState= “empty-string | ADMIN | ADMIN(READONLY) | OFFLINE”
Reports a repository state change as the result of a server pause. This attribute is set by the Pause method and cleared by the Resume method. The value is usually the server Pause value (ADMIN or OFFLINE), unless the repository is registered with a less restrictive Access value.
empty string
Indicates the SAS Metadata Server is online. It has not been paused by the Pause method. The repository can be accessed in its intended access mode.
ADMIN
Indicates this repository has been downgraded to an ADMIN state by a server pause. Only users who have administrative status on the server can read and write to this repository.
ADMIN(READONLY)
Indicates this repository has been downgraded to an ADMIN state by a server pause. Its intended state is READONLY. It is available for reading only to users who have administrative status on the server.
OFFLINE
Indicates the repository is not available to any users because the SAS Metadata Server has been paused to an OFFLINE state or the repository is registered with Access="OMS_OFFLINE".
CurrentAccess= “READONLY | OFFLINE”
The SAS Metadata Server manages two copies of repositories: a memory version and a disk version. The memory version enables updates to be made available to clients before the disk version is updated. This attribute is set by the SAS Metadata Server on the memory version of the repository when the repository cannot be updated by the server because the repository has an incompatible repository format or has encountered an I/O error. This attribute is not stored in the disk version of the repository. When a problem is encountered, valid values are READONLY and OFFLINE. When the SAS Metadata Server can access a repository as intended, GetRepositories returns a CurrentAccess value that matches the repository's Access attribute.
The additional attributes that are retrieved by OMI_ALL are available in the standard interface and the DoRequest method when the method is issued on a SAS Metadata Server that is ONLINE or paused to an ADMIN state. A GetRepositories method that is issued on a SAS Metadata Server that is paused to an OFFLINE state returns an error, unless the method is issued in the standard interface.

Example 1: Standard Interface

The following is an example of how to issue the GetRepositories method regardless of the programming environment. The request has no flags set.
flags=0;
options="";
rc = GetRepositories(repositories,flags,options);
Here is an example of the output returned by the SAS Metadata Server:
<!-- XML string returned in repositories parameter -->
<Repositories>   
   <Repository Id="A0000001.A0000001" Name="REPOSMGR"      
      Desc="The Repository Manager"  DefaultNS="REPOS"/>   
   <Repository Id="A0000001.A5FYFEK5" Name="Foundation" 
      Desc="Foundation repository" DefaultNS="SAS"/>
     <Repository Id="A0000001.A5HZY944" Name="Repository 1" 
      Desc="First repository created for FULL access" 
      DefaultNS="SAS"/>
   <Repository Id="A0000001.A5G3R7J5" Name="Repository 2" 
      Desc="Second repository created for READONLY access" 
      DefaultNS="SAS"/>
   <Repository Id="A0000001.A5SAMPL3" Name="Repository 3" 
      Desc="Third repository created for ADMIN access" 
      DefaultNS="SAS"/>
   <Repository Id="A0000001.A56DZUC5" Name="Repository 4" 
      Desc="Fourth repository created for OFFLINE access" 
      DefaultNS="SAS"/>
   <Repository Id="A0000001.A5G67U31" Name="Repository 5" 
      Desc="Project repository" DefaultNS="SAS"/>
</Repositories>

Example 2: DoRequest Method

The following is an example of an XML string that shows how to format the request in example 1 for the INMETADATA parameter of the DoRequest method.
<!-- XML string for inMetadata parameter of DoRequest method call -->
<GetRepositories>   
   <Repositories/>   
   <Flags>0</Flags>   
   <Options/>
</GetRepositories>
For an example that sets the OMI_ALL (1) flag, see Using GetRepositories to Get Repository Access and Status Information.