Resource Heirarchy
See also:
[SHOW
] [DESCRIBE
]
Objects in StackQL are represented in the following hierarchy, with an example using the Google Cloud provider shown:
Using the StackQL Object Notation
This hierarchy is expressed in the object notation <provider>.<service>.<resource>
within the context of a given provider, an example of this object notation used in a SELECT
statement is shown here:
-- Selecting all resources deployed within a service using a basic SELECT statement
SELECT * FROM google.compute.instances
WHERE project = 'stackql-demo'
AND zone = 'australia-southeast1-a';
-- Selecting all resources deployed within a service using a basic SELECT statement
SELECT * FROM google.compute.instances
WHERE project = 'stackql-demo'
AND zone = 'australia-southeast1-a';
If a resource or service contains a period (.
) in the name, use the backtick symbol (`) to encapsulate the resource name, for example:
SELECT * FROM google.container.`projects.zones.clusters.nodePools`;
Showing Services in a Provider
Services within a provider can be listed using the SHOW SERVICES
command as shown here:
-- Returns all of the available services in a cloud provider
SHOW SERVICES IN google;
Showing Resources within a Service
Similarly resources within a service can be listed using the SHOW RESOURCES
as shown here:
-- Returns all of the available resources in a cloud provider service
SHOW RESOURCES IN google.compute;
Showing Fields within a Resource
Fields within a resource can be displayed using a DESCRIBE
statement as shown here:
-- Returns all of the available fields in a resource
DESCRIBE google.compute.instances;
Showing Executable Methods for a Resource
Methods available for a resource can be displayed using a SHOW METHODS
command as shown here:
-- Show all of the available methods for a resource
SHOW METHODS IN google.compute.instances;