Working with FICO Drive
FICO Drive is implemented as a layer above Amazon's S3 service.
s3
library:
uses "s3"
Then declare a variable of type
s3bucket
to represent the cloud-based bucket you wish to access:
declarations
mybucket: s3bucket
end-declarations
For further details of the FICO Drive API, refer to the S3 Library for Mosel reference manual, located at http://www.fico.com/fico-xpress-optimization/docs/latest/mosel/S3/dhtml .
Using FICO Drive to share files within a solution
When invoked by Xpress Executor, a Mosel model instance is automatically configured to access a bucket available to all DMP components in the current solution. Its credentials can be initialized by a call to s3init
with the string "solutionData"
, or the constant S3_DMP_SOLUTIONDATA
which evaluates to it.
mybucket
:
model DmpInitExample
uses "s3"
declarations
mybucket: s3bucket
end-declarations
! Initialize mybucket using ‘solutionData’ set of credentials
s3init(mybucket, S3_DMP_SOLUTIONDATA)
if s3status(mybucket)<>S3_OK then
writeln("Bucket initialization error: ", s3getlasterror(mybucket))
exit(1)
end-if
! mybucket now initialized and can be used
end-model
From this point,
mybucket
is available to your Mosel code via an API that allows you to manipulate cloud-based files (upload, download, delete) and their metadata and tags, and access status objects that report on the success or failure of your API calls.
Using FICO Drive to share files between solutions
When invoked by Xpress Insight, a Mosel model instance is automatically configured to access a bucket available to all DMP components in your tenant. Its credentials can be initialized by a call to s3init with constant S3_DMP_TENANTSHARED which evaluates to it. Note that this single bucket is shared between component lifecycles - there are not separate buckets for design, staging and production.
model DmpInitExample
uses "s3"
declarations
mybucket: s3bucket
end-declarations
! Initialize mybucket using ‘tenantShared' set of credentials
s3init(mybucket, S3_DMP_TENANTSHARED)
if s3status(mybucket)<>S3_OK then
writeln("Bucket initialization error: ", s3getlasterror(mybucket))
exit(1)
end-if
! mybucket now initialized and can be used
end-model
From this point, mybucket
is available to your Mosel code via an API that allows you to manipulate cloud-based files (upload, download, delete) and their metadata and tags, and access status objects that report on the success or failure of your API calls.
© 2001-2024 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.