How to specify AMI Name when creating image using ImportImage - aws-java-sdk

Is it possible to specify AMI Name when creating image using ImportImage API?
It is generated automatically like "import-ami-abcd1234". But I would like to give more reasonable name.
ImportImageRequest does not have "Name" parameter:
http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/ec2/model/ImportImageRequest.html
While CreateImageRequest that creates AMI from an instance does have it.
CreateImageRequest createImageRequest = new CreateImageRequest();
createImageRequest.withInstanceId("i-xxxxxxxxxxxxxxxxx")
.withName("myAMIName")
.withDescription("this is my ami");
Or is it possible to modify the AMI Name after the ImportImage ?
Thanks in advance.

The AMI Name could not be changed. You can:
You can do additional step to copy the image after it was imported. Using AWS Java SDK to set the name when you copy the image.
Then delete the imported image

Related

Lambda trigger dynamic specific path s3 upload

I am trying to create a lambda function that will get triggered once a folder is uploaded to a S3 Bucket. But the lambda will perform an operation that will save files back on the same folder, how can I do so without having a self calling function?
I want to upload the following folder structure to the bucket:
Project_0001/input/inputs.csv
The outputs will create and be saved on:
Project_0001/output/outputs.csv
But, my project number will change, so I can't simply assign a static prefix. Is there a way of dynamically change the prefix, something like:
Project_*/input/
From Shubham's comment I drafted my solution using the prefix and sufix.
For my case, I stated the prefix being 'Project_' and for the suffix I choose one specific file for the trigger, so my suffix is '/input/myFile.csv'.
So every time I upload the structure Project_/input/allmyfiles_with_myFile.csv it triggers the function and then I save my output in the same project folder, under the output folder, thus not triggering the function again.
I get project name with the following code
key = event['Records'][0]['s3']['object']['key']
project_id = key.split("/")[0]

Create a folder about an item with Microsoft Graph Sharepoint

How do I create a folder on my list? I can create a file but I can't define a type.
Should I define a type column? But how can I create a column with a type characteristic?
I am using Graph Explorer to build and want to use PHP after for my Laravel website.
Thank you for your answers !
After testing and testing, i find my request.
If it can help someone :
POST https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/children
site-id is composed about two ID, site-id and subsite-id.
To find your site-id :
GET https://graph.microsoft.com/v1.0/sites/root
My subsite-id is my groupsite id, you can find him on :
GET https://graph.microsoft.com/v1.0/sites/{sites-id}/lists?search=doc
After i did a request to find {item-id} :
GET https://graph.microsoft.com/v1.0/sites/{site-id}/drive/root:/test
And to end :
POST https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/children
You can create a new list with a document library as a template. Then you will have a new drive in the root of your site where you can create a folder.

Is it possible to rename png files by the time of creation, not after

I am using File[] imageFile = PdfUtilities.convertPdf2Png(new File("MYPATH")) command to generate png from pdf , which is giving file name as "workingimage01","workingimage02"...."workingimage0n" and so on, is it possible to change this name setting by the time png's are generated. Thanks in advance.
I am trying this command for 10 pdf parallel, so it is overlapping. thats why i need to know is there a way or i am asking out of the box question.
The name is hard coded in the source. You can create an overloaded method that takes another parameter for the working files' name.

Pentaho: Image in Pentaho form

I want to fetch image from local path (i.e: C:/Users/myname/sample.jpg).
Already tried with image icon on left of the form and set the value from the above both but the thing is i need to set the image from external . Like property file or kettle file.
please help me on this.im using Pentaho Designer 5.3.0
thanks in advance
If you want to get the location of the image from a property file, you have to think about how to get that value and take it to the report, that you can do with a kettle transformation, that takes the value you want from the properties file and send it to a Report, in the pdi there is a step called Pentaho Reporting Ouput, which makes a call to the report, to this you will pass as parameter the location of the image that you want to be displayed (the name of the parameter in the pdi and in the Report designes must be the same), you can do the following:
Create a parameter, which will be of type string, this will be the parameter will receive the location of the image on the disk
Add an image field instead of an image, and pass the parameter you created as a value
After you can upload the image you want, just pass the physical address to the report from the pdi.
I hope I help you

ruby on rails AWS-S3 list files in a bucket

I have a select box the I wish to fill with filenames from a clients S3 bucket.
In my controller I set the variable as this:
#files = AWS::S3::Bucket.find("clientsbucket").objects
which when called in the view as options_for_select(#files) gives a list of objects but in the format of <AWS::S3::Object:0x4f9e5b8>, <AWS::S3::Object:0x4f9e5a0> etc
For the life of me I cant figure out how to list the filename instead of this object info?
Any help muchly appreciated
Well, access the key property of the each object in the view!
key property is the entire path to the file in the bucket.
objects.each do |object|
= object.key
Even though the AWS SDK Documentation isn't as informative try and dig around..
Use the as_tree method on the objects so you can get the specific data you want.
http://docs.amazonwebservices.com/AWSRubySDK/latest/AWS/S3/Tree.html
Good luck!!