I have a JAVA application that includes creating VM instances in GCP.
I now am attempting to use the new "machine images" functionality in order to be able to replicate whole instances (as opposed to using the images from disk option).
I am using the beta api to create images from instances, however I need to be able to then fetch a list of these machine-images back to my application in order for them to be used to create new instances.
I am looking for some GET api for this purpose, but
I cannot find documentation on this anywhere. any ideas??
As per this doc you can get list of machine images within a project.
Related
I'm following along with the Using AES-128 Dynamic Encryption and Key Delivery Service tutorial. I am using the Azure java SDK and I can't find a way to use the StorageEncrypted option for newly created assets (i.e. assets created as a result of transcoding). When I upload my high-quality source file I'm able to use setOptions(AssetOption.StorageEncrypted) when creating the Azure asset. I see in the Encode the asset containing the file to the adaptive bitrate MP4 set portion of the tutorial that it is possible to tell Azure I want to use StorageEncrypted on my new asset from the following C# code:
encodeTask.OutputAssets.AddNew(String.Format("{0} as {1}", inputAsset.Name, encodingPreset), AssetCreationOptions.StorageEncrypted);
I found a few vague mentions of encryption in the Task.CreateBatchOperation JavaDocs but it is unclear what they are used for or what values might make sense.
So, my question is: how do I tell Azure to use StorageEncrypted when creating new assets from a transcode using the Java SDK?
I believe I've found the solution in the REST API docs. Basically just add a assetCreationOptions='1' attribute on your outputAsset element in the taskBody.
I'm thinking the Java SDK simply isn't on par with .Net (which makes sense given the source). You might be better off just using the REST API directly as there are several missing pieces in the Java SDK.
I created a web application using Java Spring, Hibernate, with JSP's. It's basically a blog I made from scratch, so there's an interface where I can add a new blog post with pictures.
I use Heroku to host and deploy the app.
When I want to post images in a blog post, I do:
And that image is currently stored in a resource folder right outside of 'WEB-INF'. Except, as I add more blog posts, I will have a lot of large sized pictures. I don't know where I should store these images and how I should access it. I thought of storing it in the file system, but wouldn't I have to re-deploy the app on heroku each time I add more images? Another option was having a public dropbox folder and linking the images there, but that would open up my entire dropbox directory to the public. Is there a better way to do all of this, especially managing so many large pictures?
Saving files in file system is not a scalable solution. If you add new servers for your web app the images won't be displayed correctly for any request.
You have to save your images in a distributed environment. It can be a LOB column on the database (Postgres for example) or an Amazon S3 storage system.
The access type is very different but both systems are a good option for your images. If they are big in size, S3 is the best option.
I want to export data from a Lotus Notes database .nsf that lives on my local computer. I want to write a java program that will connect to this .nsf lotus notes database and export data from a view/form.
I am not sure how to do that ? Is there a sample code that i can refer too or a JDBC-ODBC driver ?
You actually have two issues/questions.
1) How to use Java to connect to a Notes database
2) How to export data from documents (let's use the correct terminology, form is a design element, data is stored in documents)
For 1) there is plenty of sample code available, like the link poisonedYouth referenced in his response.
For 2) I would suggest looking at the samples in the Domino Designer help. You need to undertand that Domino Object Model (DOM) first, and know how that data is stored.
But you would probably do something like this:
Create a new NotesSession object
Get a NotesDatabase object from the session
Get a NotesView object from the database
Now you can do it different ways, depending on éxactly what you want to do and things like what items are being displayed in the view.
If all fields you want to export are displayed in the view, I would do this:
Get a NotesViewEntryCollection document from the view
Use GetFirstEntry and GetNextEntry methods to loop through the collection and get the individual entries
Use the ColumnValues property of the NotesViewEntry object to get the values displayed in the view, then export those values the way you want it.
If you don't have all the values displayed in the view, use this (slower) method:
Use the GetFirstDocument and GetNextDocument methods to loop through all NotesDocuments in the view
For each document, read the field values using GetItemValues (remember that all field values are returned as an array, even if they only contain one value) and export them the way you like.
Exporting data from Notes is a very common process, and you should be able to find plenty of code.
I have a tool available(it is not open source, though) here: http://www.texasswede.com/websites/texasswede.nsf/Page/Notes%20XML%20Exporter
I also posted code on my blog that you can look at and modify: http://blog.texasswede.com/export-notes-view-to-excel-with-multi-value-fields/
I found an article with topic "Writing standalone Java code that connects to IBM Lotus Domino"
http://www-10.lotus.com/ldd/dominowiki.nsf/dx/06082009125716AMWEB7TU.htm
I recommend trying IBM Security Directory Integrator (former Tivoli Directory Integrator, or TDI). It's a integration tool especially built for your purpose.
SDI operates using so-called assembly lines where you have one or more sources and one or more destinations. In between you can manipulate your data to your hearts desire.
Some versions of TDI/SDI are free with the newest versions of IBM Domino.
Check out these sites for more info:
http://www.tdi-users.org/twiki/bin/view/Integrator/WebHome
http://www.ibm.com/developerworks/downloads/tiv/tdi/
http://www-03.ibm.com/software/products/en/directoryintegrator
Good luck!
Ove
I need to make a data file to hold two empty tables with many fields
I have been successful at making a MySQL 5.5 Table with its DOS style IDE OK.
And MySQL registers with NetBeans very well.
Can I make a script to build this from with in my program
or can this be done directly in Java and get a Java file to read file parameters as its executed to create the data base file name.
I have no idea what direction to take to do this and what's possible.
I'm writing in Java and Delphi and Delphi has no MySQL support.
Has any one done anything similar before and how did they do it
The database is to hold 70 meduim size pictures, How slow will updates be when accessing pictures and should I use JPEG or BMP storage for wireless Java apps?
Can Java manage JPEG files and display them?
Lots of questions in one post. Let me try to address each point individually.
Yes, you can write Java code to create your MySQL database for you. On the other hand, tools such Liquibase can do this for you—you just need to learn its XML configuration syntax.
Lots of people have successfully written Java and Delphi code to access MySQL databases. If I recall correctly, at the very least Delphi supports MySQL access through ODBC, if not, through 3rd-party custom components.
Java can store & retrieve JPEG images to/from a database just like any other language, though, in practice, I wouldn't do it that way. Rather, I'd store the images themselves in the file system and just store their locations in the database. RDBMSes weren't really built with handling large binary BLOBs in mind.
How would you like to display the images? If on screen via a desktop client, then, yes, Java's Swing components can easily and readily display JPEG, even GIF & PNG images. If via a Web browser or remote client, then it's really just a matter of serving the images over HTTP to the browser/client app.
In my web app while creating a particular item users can browse and add images.I want to store these images in CVS.Any idea on how to do it??
I want to store these images in CVS.Any idea on how to do it??
To access CVS from within java, you could either start a separate CVS-process using say ProcessBuilder, or use one of the following libraries.
JavaCVS
JCVS