s3init
s3init |
Purpose
Synopsis
procedure s3init(bucket:s3bucket, cfgid:text)
procedure s3init(bucket:s3bucket, type:text, env:text)
Arguments
bucket
|
S3 bucket to be configured
|
cfgid
|
The ID of the bucket configuration to use. When used within DMP, this may be one of the constants
S3_DMP_SOLUTIONDATA and
S3_DMP_TENANTSHARED, or the return value from the
s3solutiondata or
s3solutionrevision functions.
|
type
|
Within DMP, the type of the folder you want to use; the only supported value is the constant
S3_DMP_SOLUTIONDATA
|
env
|
Within DMP, the lifecycle stage to access; one of the constants
S3_DMP_DESIGN,
S3_DMP_STAGING,
S3_DMP_PRODUCTION.
|
Example
Example of initializing an s3bucket to use the DMP
solutionData folder.
declarations mybucket: s3bucket end-declarations s3init(mybucket,S3_DMP_SOLUTIONDATA) if s3status(mybucket)<>S3_OK then writeln("Error returned by S3: ",s3getlasterror(mybucket)) exit(1) end-if
Further information
1. After calling, check the value of
s3status for any errors.
2. If the supplied
s3bucket has already been initialized, the previous configuration will be overwritten.
3. After a s3bucket has been initialized using
s3init, it will not be possible to change the
url or
region field directly.
4. When used within DMP, this function allows you to access S3 folders provided by the platform. You will pass the constant
S3_DMP_SOLUTIONDATA or
S3_DMP_TENANTSHARED to access the default solution-data or tenant-global folders respectively, or the return value of the functions
s3solutiondata or
s3solutionrevision to access solution data of a specific environment or assets of a solution revision.
5. The 3-argument version of this function is deprecated since version 0.1.0 of the S3 module. It was previously used to specify the environment of the solution data folder to access; new code should use the 2-argument
s3init procedure with the return value from
s3solutiondata instead.
6. When the model is running in Xpress Workbench within DMP, only the S3_DMP_SOLUTIONDATA folder type is supported and the third parameter must not be specified (ie only access to the "solution data" folder for the current lifecycle stage is supported).
Related topics