Class: Infrawrench::ResourcesNamespace
- Inherits:
-
Object
- Object
- Infrawrench::ResourcesNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.resources
Instance Attribute Summary collapse
-
#manifest ⇒ ResourcesManifestNamespace
readonly
client.resources.manifest. -
#secret_versions ⇒ ResourcesSecretVersionsNamespace
readonly
client.resources.secret_versions.
Instance Method Summary collapse
-
#attach(body:, org_id: nil, request_options: nil) ⇒ Hash
Attach a resource onto another (e.g. disk → VM).
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a new resource via its plugin.
-
#create_config(body:, org_id: nil, request_options: nil) ⇒ Hash
Get the dynamic create form for a resource type.
-
#create_cost_estimate(body:, org_id: nil, request_options: nil) ⇒ Hash
Cost estimate for the current create form values.
-
#create_pricing(body:, org_id: nil, request_options: nil) ⇒ Hash
Pricing per size for a create form.
-
#delete(plugin_id:, type_id:, resource_id:, account_id:, org_id: nil, parent_resource_id: nil, request_options: nil) ⇒ Hash
Delete a resource via the plugin.
-
#describe(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Get human-readable describe text for a resource.
-
#detail(plugin_id:, type_id:, resource_id:, org_id: nil, account_id: nil, parent_resource_id: nil, include_peer_panes: nil, request_options: nil) ⇒ Hash
Full resource detail page payload.
-
#export_credential(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Export a credential file for a resource (one-time reveal).
-
#field_action(body:, org_id: nil, request_options: nil) ⇒ Hash
Execute an in-form field action (e.g. generate an IAM role).
-
#import_yaml(plugin_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Bulk-import resources from YAML (kubectl apply -f equivalent).
-
#initialize(transport) ⇒ ResourcesNamespace
constructor
private
A new instance of ResourcesNamespace.
-
#invoke_action(body:, org_id: nil, request_options: nil) ⇒ Hash
Invoke a plugin-defined action on a resource.
-
#logs(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Fetch logs for a resource.
-
#metrics(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Fetch metric series for a resource.
-
#nosql_command(body:, org_id: nil, request_options: nil) ⇒ Hash
Run a NoSQL document-browser command (e.g. MongoDB shell).
-
#peer_panes(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Array<Hash>
Lazy-fetch peer-integration panes for a resource.
-
#picker_resources(body:, org_id: nil, request_options: nil) ⇒ Array<Hash>
Fetch options for a
resource-pickerfield. -
#update(body:, org_id: nil, request_options: nil) ⇒ Hash
Update a resource via its plugin.
Constructor Details
#initialize(transport) ⇒ ResourcesNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ResourcesNamespace.
2653 2654 2655 2656 2657 |
# File 'lib/infrawrench/client.rb', line 2653 def initialize(transport) @transport = transport @manifest = ResourcesManifestNamespace.new(@transport) @secret_versions = ResourcesSecretVersionsNamespace.new(@transport) end |
Instance Attribute Details
#manifest ⇒ ResourcesManifestNamespace (readonly)
Returns client.resources.manifest.
2647 2648 2649 |
# File 'lib/infrawrench/client.rb', line 2647 def manifest @manifest end |
#secret_versions ⇒ ResourcesSecretVersionsNamespace (readonly)
Returns client.resources.secret_versions.
2649 2650 2651 |
# File 'lib/infrawrench/client.rb', line 2649 def secret_versions @secret_versions end |
Instance Method Details
#attach(body:, org_id: nil, request_options: nil) ⇒ Hash
Attach a resource onto another (e.g. disk → VM)
Requires permission: resources:write.
POST /api/org/orgId/resources/attach
Raises on 400: Bad request
Raises on 404: Not found
2675 2676 2677 2678 2679 2680 2681 2682 2683 |
# File 'lib/infrawrench/client.rb', line 2675 def attach(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/attach", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a new resource via its plugin
Requires permission: resources:write.
POST /api/org/orgId/resources/create
Raises on 400: Bad request
Raises on 404: Not found
2702 2703 2704 2705 2706 2707 2708 2709 2710 |
# File 'lib/infrawrench/client.rb', line 2702 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/create", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#create_config(body:, org_id: nil, request_options: nil) ⇒ Hash
Get the dynamic create form for a resource type
Calls the plugin's getCreateConfig. The returned CreateResourceConfig
is plugin-shaped — see JsonObject.
Requires permission: resources:write.
POST /api/org/orgId/resources/create-config
Raises on 400: Bad request
Raises on 404: Not found
2731 2732 2733 2734 2735 2736 2737 2738 2739 |
# File 'lib/infrawrench/client.rb', line 2731 def create_config(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/create-config", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#create_cost_estimate(body:, org_id: nil, request_options: nil) ⇒ Hash
Cost estimate for the current create form values
Requires permission: resources:read.
POST /api/org/orgId/resources/create-cost-estimate
2753 2754 2755 2756 2757 2758 2759 2760 2761 |
# File 'lib/infrawrench/client.rb', line 2753 def create_cost_estimate(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/create-cost-estimate", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#create_pricing(body:, org_id: nil, request_options: nil) ⇒ Hash
Pricing per size for a create form
Requires permission: resources:read.
POST /api/org/orgId/resources/create-pricing
2775 2776 2777 2778 2779 2780 2781 2782 2783 |
# File 'lib/infrawrench/client.rb', line 2775 def create_pricing(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/create-pricing", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(plugin_id:, type_id:, resource_id:, account_id:, org_id: nil, parent_resource_id: nil, request_options: nil) ⇒ Hash
Delete a resource via the plugin
Requires permission: resources:delete.
DELETE /api/org/orgId/resources/pluginId/typeId
Raises on 400: Bad request
Raises on 404: Not found
2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 |
# File 'lib/infrawrench/client.rb', line 2805 def delete( plugin_id:, type_id:, resource_id:, account_id:, org_id: nil, parent_resource_id: nil, request_options: nil ) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/resources/{pluginId}/{typeId}", path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id }, query: { "resourceId" => resource_id, "accountId" => account_id, "parentResourceId" => parent_resource_id }, request_options: ) end |
#describe(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Get human-readable describe text for a resource
Requires permission: resources:read.
POST /api/org/orgId/resources/pluginId/typeId/describe
Raises on 400: Bad request
Raises on 404: Not found
2845 2846 2847 2848 2849 2850 2851 2852 2853 |
# File 'lib/infrawrench/client.rb', line 2845 def describe(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/describe", path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id }, body: body, request_options: ) end |
#detail(plugin_id:, type_id:, resource_id:, org_id: nil, account_id: nil, parent_resource_id: nil, include_peer_panes: nil, request_options: nil) ⇒ Hash
Full resource detail page payload
Performs a live listResources against the provider, falls back to DB on
failure, and returns the plugin's renderDetail schema plus host-derived
flags (SQL/KV/SSH availability, child resources, peer panes, etc).
Requires permission: resources:read.
GET /api/org/orgId/resources/pluginId/typeId/detail
Raises on 400: Bad request
Raises on 404: Not found
2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 |
# File 'lib/infrawrench/client.rb', line 2881 def detail( plugin_id:, type_id:, resource_id:, org_id: nil, account_id: nil, parent_resource_id: nil, include_peer_panes: nil, request_options: nil ) @transport.request( http_method: "GET", path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/detail", path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id }, query: { "resourceId" => resource_id, "accountId" => account_id, "parentResourceId" => parent_resource_id, "includePeerPanes" => include_peer_panes }, request_options: ) end |
#export_credential(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Export a credential file for a resource (one-time reveal)
Requires permission: secrets:read.
POST /api/org/orgId/resources/pluginId/typeId/export-credential
Raises on 400: Bad request
Raises on 404: Not found
2923 2924 2925 2926 2927 2928 2929 2930 2931 |
# File 'lib/infrawrench/client.rb', line 2923 def export_credential(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/export-credential", path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id }, body: body, request_options: ) end |
#field_action(body:, org_id: nil, request_options: nil) ⇒ Hash
Execute an in-form field action (e.g. generate an IAM role)
Calls the plugin's executeFieldAction. Returns { value } to assign to
the field; for select fields the optional option should be spliced
into the options list so the new value can be displayed.
POST /api/org/orgId/resources/field-action
Raises on 400: Bad request
Raises on 404: Not found
2952 2953 2954 2955 2956 2957 2958 2959 2960 |
# File 'lib/infrawrench/client.rb', line 2952 def field_action(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/field-action", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#import_yaml(plugin_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Bulk-import resources from YAML (kubectl apply -f equivalent)
Requires permission: resources:write.
POST /api/org/orgId/resources/pluginId/import-yaml
Raises on 400: Bad request
Raises on 404: Not found
2979 2980 2981 2982 2983 2984 2985 2986 2987 |
# File 'lib/infrawrench/client.rb', line 2979 def import_yaml(plugin_id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/{pluginId}/import-yaml", path_params: { "orgId" => org_id, "pluginId" => plugin_id }, body: body, request_options: ) end |
#invoke_action(body:, org_id: nil, request_options: nil) ⇒ Hash
Invoke a plugin-defined action on a resource
Requires permission: resources:write.
POST /api/org/orgId/resources/invoke-action
Raises on 400: Bad request
Raises on 404: Not found
3005 3006 3007 3008 3009 3010 3011 3012 3013 |
# File 'lib/infrawrench/client.rb', line 3005 def invoke_action(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/invoke-action", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#logs(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Fetch logs for a resource
Requires permission: resources:read.
POST /api/org/orgId/resources/pluginId/typeId/logs
Raises on 400: Bad request
Raises on 404: Not found
3033 3034 3035 3036 3037 3038 3039 3040 3041 |
# File 'lib/infrawrench/client.rb', line 3033 def logs(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/logs", path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id }, body: body, request_options: ) end |
#metrics(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Fetch metric series for a resource
Requires permission: resources:read.
POST /api/org/orgId/resources/pluginId/typeId/metrics
Raises on 400: Bad request
Raises on 404: Not found
3061 3062 3063 3064 3065 3066 3067 3068 3069 |
# File 'lib/infrawrench/client.rb', line 3061 def metrics(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/metrics", path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id }, body: body, request_options: ) end |
#nosql_command(body:, org_id: nil, request_options: nil) ⇒ Hash
Run a NoSQL document-browser command (e.g. MongoDB shell)
Requires permission: resources:execute.
POST /api/org/orgId/resources/nosql-command
Raises on 400: Bad request
Raises on 404: Not found
3087 3088 3089 3090 3091 3092 3093 3094 3095 |
# File 'lib/infrawrench/client.rb', line 3087 def nosql_command(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/nosql-command", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#peer_panes(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Array<Hash>
Lazy-fetch peer-integration panes for a resource
Requires permission: resources:read.
POST /api/org/orgId/resources/pluginId/typeId/peer-panes
Raises on 404: Not found
3114 3115 3116 3117 3118 3119 3120 3121 3122 |
# File 'lib/infrawrench/client.rb', line 3114 def peer_panes(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/peer-panes", path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id }, body: body, request_options: ) end |
#picker_resources(body:, org_id: nil, request_options: nil) ⇒ Array<Hash>
Fetch options for a resource-picker field
Requires permission: resources:read.
POST /api/org/orgId/resources/picker-resources
3137 3138 3139 3140 3141 3142 3143 3144 3145 |
# File 'lib/infrawrench/client.rb', line 3137 def picker_resources(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/picker-resources", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#update(body:, org_id: nil, request_options: nil) ⇒ Hash
Update a resource via its plugin
Applies the supplied field changes upstream and persists the refreshed
fields/display name to the DB. The body's fields map only carries the
keys the caller actually changed.
POST /api/org/orgId/resources/update
Raises on 400: Bad request
Raises on 404: Not found
3166 3167 3168 3169 3170 3171 3172 3173 3174 |
# File 'lib/infrawrench/client.rb', line 3166 def update(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/resources/update", path_params: { "orgId" => org_id }, body: body, request_options: ) end |