How to create artifact using management APIs with state scripts

How to create artifact using management APIs with state scripts ?

Don’t see any option to include state script in following API,
https://hosted.mender.io/api/management/v1/deployments/artifacts/generate

Regards,
Naresh

Hi @nareshtech20,

State scripts are included in an artifact during the creation process. You can add an arbitrary number by giving the --script (or short -s) parameter, followed by the script path to mender-artifact. You can get more information on the functionality of the tool by using the -h flag to print the help sections.

Greetz,
Josef

1 Like

Hi @TheYoctoJester ,

Have used mender-artifact cli for artifact creation manually, but as per organization compliance, process calls from micro service applications should be avoided, hence looking for Rest API.
Have used “https://hosted.mender.io/api/management/v1/deployments/artifacts/generate” API for artifact creation, can’t find any script option, anything I’m missing here ?

Thanks,
Naresh

Hi @nareshtech20,

As pointed out in the documentation this is only suitable for generating single file Artifact, and does not support additional parameters or scripts. The rationale behind is being able to upload a single file to the dashboard and having it packaged as an artifact.

If your company has specific needs for compliance and architecture, it might be a good idea to get in touch with our team for professional services.

Greetz,
Josef

1 Like

Thank you @TheYoctoJester, sure will check options.