Table Of Contents
RepositoryApp Service
Information About RepositoryApp Service
abortCurrentProcess
createConnection
createConnectionWithRepSvr
createRepositoryServers
deleteConnection
deleteConnectionUseRepSvr
deleteRepositoryFiles
deleteRepositoryServers
fetchAllRepositoryServers
fetchFirstLevelFileNames
fetchRecursivelyFileNames
fetchResultsFromConnection
modifyRepositoryServers
validateConnectivity
synchronizeUserCreditenalsMap
RepositoryApp Service
This chapter describes the DCNM web services' API methods for the RepositoryApp service.
Information About RepositoryApp Service
This chapter defines the services exposed by the Repository API component of the DCNM server.
abortCurrentProcess
This API will be usually called after invoking the API getResultsFromConnection(OpContext, String) to stop the current process running. Client can also invoke this API if the End of list is not reached after invoking getFirstLevelFileNames(OpContext, String, String, String, Boolean), getRecursivelyFileNames(OpContext, String, String, String, Boolean). This API will return a boolean value = true for successful abort.
Parameters
opContext—Operational context
connectionId—ConnectionId for which the current process has to be aborted
Return Value
True for successful abort, else false.
createConnection
This API is used by the client to create a connection to the repository which is in the DB. Creates a connection to the give repository InstanceNameId. Generates a unique connection Id string. This is unique across each client connections, client can create multiple connection to a single repository server with unique connection Id. Returns this connectionId to the client.
Parameters
opContext—Operational context
repositoryInstanceNameId—Repository Instance name for which a connection has to be created
Return Value
Returns a connection Id to the client.Client can use the same connection Id in successive Repository API calls on the same repository instead of new connection.
createConnectionWithRepSvr
This API is used by the client to create a temporary connection by giving a dummy ServerRepository object. This API is usually called when client wants to connect to a repository which is not created earlier. Hence the client can create a connection using this API. Creates a connection to the repository in the given ServerRepository(rfp) information. Generates a unique connection Id string. This is unique across each client connections, client can create multiple connection to a single repository server with unique connection Id. Returns this connectionId to the client.
Parameters
opContext—Operational context
rfp—Information of the repository for which a connection has to be created
Return Value
Returns a connection Id to the client.Client can use the same connection Id in successive Repository API calls on the same repository instead of new connection.
createRepositoryServers
Persist the repository information collection in DCNM server and returns the repository server collection itself. Since few properties will be manipulated and set in the server side. Client may require to know it.
Parameters
opContext—Operational context.
newRepLocationCol—Collection of Repository information to persist,
Return Value
Returns the repository server collection to the client.
deleteConnection
Disconnect and remove the repository connection for the given connectionId from the DCNM server.
Parameters
opContext—Operational context
connectionId—ConnectionId for which the connection should be disconnected and remove from DCNM server.
Return Value
void
deleteConnectionUseRepSvr
This API is used by the client, if he wants the DCNM server to disconnect and remove all connections from the given set of server repositories. This will be likely used before the ServerRepository information is going to be modified. Disconnect and remove the repository connections for the given repository information from the DCNM server.
Parameters
opContext—Operational context
repositoryCol—Repository information collection for which the connection has to be created and disconnected.
Return Value
void
deleteRepositoryFiles
This API deletes the given files on the given repository connection.
Parameters
opContext—Operational context
connectionId—connection id of a repository
pathCol—File's path collection which are to be deleted on the repository(which is containg connection connectionId)
Return Value
void
deleteRepositoryServers
Removes the repository informations from the DCNM server for the given Repository instanceNameId collection.
Parameters
opContext—Operational context.
repInstanceNameIdCol—Repository instance name collection for which repository information to be removed.
Return Value
void
fetchAllRepositoryServers
Retrieves all the repository information to the client.
Parameters
opContext—Operational context.
Return Value
Repository information collection
fetchFirstLevelFileNames
Returns the immediate file/directory names,its details under the given directory alone and filter is applied. For the retrieved file and directory names & details a List object is populated and returned.
If the given directory name is null, the retrieval of files names will be done from the repository's root directory.
if the given filter is null, all the retrieved file names are sent to client.
If the given filter is not null, the directory/file names are verified against the filter, if the verification is false, the directory/file names will be skipped. This API waits for few seconds for the result otherwise it returns the result got at that time. This API creates a background process for further result. Client can invoke getResultsFromConnection(OpContext, String) API for further results. The end of the result can be identified by a file which contains the name ":End:".
Parameters
opContext—Operational context
connectionId—ConnectionId for which the retrieval to be done from which repository
dir—dir is the directory, under which the file/directory names retrieval will be done.
filter—filter is applied on the retrieved directory and file names from repository
includeFileNames—Whether file names also will be retrieved or only directory names from repository
Return Value
Returns the List which is retrieved and populated from the repository for the given connectionId.
fetchRecursivelyFileNames
Retrieve the file names,its details recursively from the given directory and filter is applied. For the retrieved file and directories details a List object is populated and returned.
If the given directory detail is null, the retrieval will be done from the repository's root directory.
if the given filter is null, all the retrieved file details are sent to client.
If the given filter is not null, the directory/file names are verified against the filter, if the verification is false, the directory/file information is skipped. This API waits for few seconds for the result otherwise it returns the result got at that time. This API creates a background process for further result. Client can invoke getResultsFromConnection(OpContext, String) API for further results. The end of the result can be identified by a file which contains the name ":End:".
Parameters
opContext—Operational context
connectionId—ConnectionId for which the retrieval to be done from which repository
dir—dir is the directory, under which the file/directory names retrieval will be done.
filter—filter is applied on the retrieved directory and file names from repository
includeFileNames—Whether file names also will be retrieved or only directory names from repository
Return Value
Returns the List which is retrieved and populated from the repository for the given connectionId.
fetchResultsFromConnection
This API returns the accumulated result of the current process running or for the current connection. Client usually invoke this API if the End of list is not reached after invoking getFirstLevelFileNames(OpContext, String, String, String, Boolean), getRecursivelyFileNames(OpContext, String, String, String, Boolean) This API will be invoked from a loop to get the result of the current process till End of list is reached. The End of List can be identified from a file which contains the name ':End:' in this result collection. This returns the result from the process and clears the same from it, since the successive invocation of this API wont return again the same result collection. The current process can be aborted by the API abortCurrentProcess(OpContext, String)
Parameters
opContext—Operational context
connectionId—ConnectionId for which the retrieval to be done from which repository
Return Value
Returns the List which is retrieved and populated from the repository for the given connectionId.
modifyRepositoryServers
Modifies the given repository information collections in the DCNM server and returns the same collection.
Parameters
opContext—Operational context
modRepLocationCol—Modified repository information collection.
Return Value
Returns the modified repository information collection.
validateConnectivity
This API is used to verify whether the Repository is able to connect and returns the appropriate message of the cause for connection failure.
Parameters
opContext—Operational context
repositoryCol—repository collection for which the connection has to be validated
Return Value
Returns the pair object collection, where a pair object holds the reference to the boolean attribute and a message string. Boolean attribute refers to the repository is able to get connected. Message String contains the information cause of the connection failure.
synchronizeUserCreditenalsMap
Retrieves all the reposiory user creditenal from server and loaded into the locally maintaining server password map. This method is available for Cisco Nexus 7000 Series switches that run Cisco NX-OS Release 5.0(3) or later
Parameters
opContext—Operational context
Return Value
Returns the repository information.