Datasource Reference Functions

create_datasourceRef_by_id

For a specific object of a specific application type (for example, a specific Classification process), creates a reference to a datasource.

Parameters

Parameter

Description

appId

Required (integer). Identifies the application. Must be from the list below:

8 = SecurityAssessment

47 = CustomTables

51 = Classifier

datasourceId

Required (integer). Identifies the datasource (from the datasource definition).

objId

Required (integer). Identifies an instance of the appID type specified above. For example, if apID=51, this would be the ID of a classification process.

user

Required. A Guardium user account, which must be authorized to create the reference. In other words, this user either must be the owner, or must have a role in common, with both the datasource and the object.

Example

grdapi create_datasourceRef_by_id appId=51 datasourceId=20000 objId=2 user=infosec

Error Codes

ERR

Description

303

Could not create datasource ref

304

Could not create datasource ref - check user.

305

Could not retrieve application - check appId.

306

Could not retrieve Datasource - check datasourceId.

307

Could not create datasource ref - an object specified by objId may not exist.

308

Could not create datasource ref - error while getting allowed datasources.

309

Could not create datasource ref - user is not allowed to use this datasource.

310

Could not create datasource ref - error while getting allowed objects.

311

Could not create datasource ref - user is not allowed to use this object.

create_datasourceRef_by_name

For a specific object of a specific application type (for example, a specific Classification process), creates a reference to a datasource.

Parameters

Parameter

Description

application

Required. Identifies the application. Must be from the list below:

SecurityAssessment

CustomTables

Classifier

datasourceName

Required. Identifies the datasource (from the datasource definition).

objName

Required. Identifies an instance of the application type specified above. For example, if the application is Classifier, this would be the name of a specific classification process.

user

Required. A Guardium user account, which must be authorized to create the reference. In other words, this user either must be the owner, or must have a role in common, with both the datasource and the object.

Example

grdapi  create_datasourceRef_by_name   application=Classifier   datasourceName=swanSybase  objName=”class process1” user=admin

Error Codes

ERR

Description

300

Invalid application - should be one of : SecurityAssessment, CustomTables,Classifier

301

Could not retrieve Datasource - check datasourceName.

302

Could not create datasource ref - an object specified by objName may not exist.

303

Could not create datasource ref

304

Could not create datasource ref - check user.

308

Could not create datasource ref - error while getting allowed datasources.

309

Could not create datasource ref - user is not allowed to use this datasource.

310

Could not create datasource ref - error while getting allowed objects.

311

Could not create datasource ref - user is not allowed to use this object.

list_datasourceRef_by_id

For a specific object of a specific application type (for example, a specific Classification process), lists all datasources referenced.

Parameters

Parameter

Description

appID

Required (integer). Identifies the application. Must be from the list below:

8 = SecurityAssessment

47 = CustomTables

51 = Classifier

objID

Required. Identifies an instance of the application type specified above. For example, if the application is Classifier, this would be the ID of a specific classification process.

Example

grdapi list_datasourceRef_by_id appId=13 objId=1  

Error Codes

ERR

Description

305

Could not retrieve application - check appId.

341

Could not read datasource ref - error while retrieving datasources

342

Could not read datasource ref

list_datasourceRef_by_name

For a specific object of a specific application type (for example, a specific Classification process), lists all datasources referenced.

Parameters

Parameter

Description

application

Required. Identifies the application. Must be from the list below:

SecurityAssessment

CustomTables

Classifier

objName

Required. Identifies an instance of the application type specified above. For example, if the application is Classifier, this would be the name of a specific classification process.

Example

grdap list_datasourceRef_by_name application=Classifier  objName="class process1"

Error Codes

ERR

Description

300

Invalid application - should be one of : SecurityAssessment, CustomTables,Classifier

340

Could not read datasource ref - an object specified by objName may not exist.

341

Could not read datasource ref - error while retrieving datasources

342

Could not read datasource ref

remove_datasourceRef_by_id

For a specific object of a specific application type (for example, a specific Classification process), removes a datasource reference.

Parameters

Parameter

Description

appId

Required (integer). Identifies the application. Must be from the list below:

8 = SecurityAssessment

47 = CustomTables

51 = Classifier

datasourceId

Required (integer). Identifies the datasource (from the datasource definition).

objId

Required (integer). Identifies an instance of the appID type specified above. For example, if apID=51, this would be the ID of a classification process.

Example

grdapi remove_datasourceRef_by_id appId=51 datasourceId=2 objId=1

Error Codes

ERR

Description

305

Could not retrieve application - check appId.

306

Could not retrieve Datasource - check datasourceId.

321

Could not delete datasource ref

322

Could not delete datasource ref - an object specified by objId may not exist.

323

Could not delete datasource ref - Cannot delete the last datasource referenced by objId

remove_datasourceRef_by_name

For a specific object of a specific application type (for example, a specific Classification process), removes a datasource reference.

Parameters

Parameter

Description

application

Required. Identifies the application. Must be from the list below:

SecurityAssessment

CustomTables

Classifier

datasourceName

Required. Identifies the datasource (from the datasource definition).

objName

Required. Identifies an instance of the application type specified above. For example, if the application is Classifier, this would be the name of a specific classification process.

Example

grdapi remove_datasourceRef_by_name application=Classifier datasourceName=swanSybase objName=”class process1”

Error Codes

ERR

Description

300

Invalid application - should be one of : SecurityAssessment, CustomTables, Classifier

301

Could not retrieve Datasource - check datasourceName.

320

Could not delete datasource ref - an object specified by objName may not exist.

321

Could not delete datasource ref

323

Could not delete datasource ref - Cannot delete the last datasource referenced by objId