Show Table of Contents
3.4. Getting a Resource
In the Java Software Development Kit, resources can be referred to via two attributes:
name, and UUID. Both return an object with the specified attribute if that object exists.
To get a resource using the value of the
name attribute:
VM vm = api.getVMs().get("test");
To get a resource using the value of the
UUID attribute:
VM vm = api.getVMs().get(UUID.fromString("5a89a1d2-32be-33f7-a0d1-f8b5bc974ff6"));
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.