The importResource method
Imports an existing *.pes export file from the local file system to the repository.
importResource(source,target,resourceType,resourceConflict,invalidVersionConflict,
resourceDef,labelFrom,lockResolution,exclude)
| Field | Use | Type | Description | Example Value |
|---|---|---|---|---|
| source | Required | String | The fully qualified path (on the local file system) of the file to import | "C:\Temp\New.pes" |
| target | Required | String | The fully qualified repository path or object URI of the folder into which to import | "/Temp Folder"
or
"0a58c3670016a7860000
010dcee0eaa28219" |
| resourceType | Optional | String | Type of content being imported. Specify
one of the following values:
|
|
| resourceConflict | Optional | String | Indicates how to resolve duplicate ID or
name conflicts. Specify one of the following values:
|
|
| labelFrom | Optional | String | Label to use if two versions of an object have the same label. The label for the other version is discarded. Specify either source or target. If this parameter is not specified, the default value of source is used. | |
| lockResolution | Optional | String | Defines how to proceed if locked resources
are encountered. Specify one of the following values:
|
|
| invalidVersionConflict | Optional | String | Defines how to proceed if an invalid version
is encountered during the import process. Specify one of the following
values:
|
|
| resourceDef | Optional | String | Defines the processing behavior for resource
definitions. Specify one of the following values:
|
|
| exclude | Optional | String | Defines which resource types are excluded
during the import. Multiple values can be combined in any order as
a semicolon-delimited list. Specify one or more of the following values:
|
| Type | Description |
|---|---|
Boolean |
True or False based on whether
the method runs successfully. |
| Type | Description |
|---|---|
ResourceNotFoundException |
The source file or target folder does not exist. |
InsufficientParameterException |
Required parameters are not specified. |
Example
The following sample imports the contents of the drafts.pes export file to the /Demo/Drafts folder of the IBM® SPSS® Collaboration and Deployment Services Repository
from pes.api.PESImpl import PESImpl
pesImpl = PESImpl(user = "admin", password = "[{AES}KrY+KLlOYo4O6545tgGsYQ==]", host = "localhost", port = "8080", appserver_type = "websphere")
bSuccess = pesImpl.importResource(source="C:\Demo\drafts.pes",target="/Demo/Drafts")