Code Package API FAQ
Frequently Asked Questions about the Code Package API
To delete a code package, use the "alterCodePackage"
action to set its "status"
property to "deleted"
. It marks the code package as deleted and does not physically remove it from the server because the server acts as a version control system. The server will not run a code package that is deleted.
The only difference between "developing"
, "inactive"
, and "deleted"
is the reason why you prevent the server from running the code package. Each deactivates a code package and prevents the server from running it.
To undelete a code package, use the "alterCodePackage"
action to set its "status"
property to any valid value except "deleted"
, such as "active"
, "testing"
, "deprecated"
, "developing"
, or "inactive"
.
To prepare a code package for running in a production environment, use the "alterCodePackage"
action to set its "status"
property to "active"
. The server enables the code package to run in all places where it is configured to run, such as an integration table transform, a getRecords transform, a trigger, a job, etc.
The only difference between "active"
, "testing"
, and "deprecated"
is the reason why you allow the server to run the code. Each activates a code package and allows the server to run it.
To prepare a code package for running in a test environment, use the "alterCodePackage"
action to set its "status"
property to "testing"
. Like the "active"
status, the server enables the code package to run in all places where it is configured to run, such as an integration table transform, a getRecords transform, a trigger, a job, etc.
The only difference between "active"
, "testing"
, and "deprecated"
is the reason why you allow the server to run the code. Each of these statuses activates a code package and allows the server to run it.
You can deprecate a code package to indicate that another code package should be used instead. To do so, use the "alterCodePackage"
action to set its "status"
property to "deprecated"
. Like the "active"
status, the server enables the code package to run in all places where it is configured to run, such as an integration table transform, a getRecords transform, a trigger, a job, etc.
The only difference between "active"
, "testing"
, and "deprecated"
is the reason why you allow the server to run the code. Each activates a code package and allows the server to run it.
When you are developing code in a code package, you often want to save it to the server for safekeeping and version control. If you want to prevent the server from accidentally running the code package, use the "alterCodePackage"
action to set its "status"
property to "developing"
. When you want to run the code for testing, set the status to "testing"
. When code is ready to be used in a production environment, set its status to "active"
.
The only difference between "developing"
, "inactive"
, and "deleted"
is the reason why you prevent the server from running the code package. Each deactivates a code package and prevents the server from running it.
When you want the server to continue running a code package while you develop an improved version of it, clone or copy the code in the package to another package with the same "codeType"
. You may want to name the temporary package something like "tempTrigger"
or "tempGetRecordsTransform"
. You do not need to create new code packages each time. You can reuse the same temporary package.
While modifying the code in the temporary package, set its "status"
property to "developing"
. While testing it, set its status to "testing"
.
When you are ready to deploy the improved code, use the "alterCodePackage"
action to save the new code into the original code package. The server finishes running the current code and starts using the new code the next time it runs the code package.
Set the status of the temporary code package to "inactive"
when not using it to prevent the server from accidentally running it.
When you want to temporarily prevent a code package from running, use the "alterCodePackage"
action to set its status to "inactive"
. This status is useful to stop an out-of-control code package. When you are ready to let the server run the code package again, set its "status"
property to "active"
, "testing"
, or "deprecated"
.
The only difference between "developing"
, "inactive"
, and "deleted"
is the reason why you prevent the server from running the code package. Each deactivates a code package and prevents the server from running it.
To list all code packages, omit the "statusFilter"
property when you run the "listCodePackages"
action.
Use the "listCodePackages"
action to return a filtered list of code packages. Set its "codeTypeFilter"
property to the types of code packages you want to include, such as ["getRecordsTransform", "integrationTableTransform"]
. Omit its "codeTypeFilter"
property to return all types of code packages.
Use the "listCodePackages"
action to return a filtered list of code packages. Set its "statusFilter"
property to the statuses you want to be included in the results. To include all runnable code packages set "statusFilter"
to ["active", "testing", "deprecated"]
.
Use the "listCodePackages"
action to return a filtered list of code packages. Set its "statusFilter"
property to the statuses you want to be included in the results. To include all non-runnable code packages set "statusFilter"
to ["inactive", "developing", "deleted"]
and set "includeDeactivatedCode"
to true
.
To list all non-deleted code packages, use the "listCodePackages"
action and set its "statusFilter"
property to ["active", "testing", "deprecated", "inactive", "developing"]
and set "includeDeactivatedCode"
to true
.
To list deleted code packages, use the "listCodePackages"
action and set its "statusFilter"
property to ["deleted"]
and set "includeDeactivatedCode"
to true
.
To list some or all versions of a code package, use the "listCodePackageHistory"
action and set its "partialName"
property to the name of the code package. To filter the list, you can optionally set additional properties to filter the results by version number, status, comments, metadata, and description.
To retrieve the code for a specific version of a code package, use the "describeCodePackageHistory"
action.
To retrieve the code for some or all versions of a code package, use the "describeCodePackageHistory"
action and set its "codeName"
property to the name of the code package. You can optionally set a range of version numbers to return specific versions of code.
To retrieve a list of a code package's versions, use the "listCodePackageHistory"
action.