linode.getChildAccounts
Explore with Pulumi AI
Provides information about Linode Child Accounts that match a set of filters. For more information, see the Linode APIv4 docs.
NOTE: Parent/Child related features may not be generally available.
Example Usage
The following example shows how one might use this data source to access Child Accounts under the current Account.
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const all = linode.getChildAccounts({});
const filtered = linode.getChildAccounts({
filters: [
{
name: "email",
values: ["example@linode.com"],
},
{
name: "first_name",
values: ["John"],
},
{
name: "last_name",
values: ["Smith"],
},
],
});
export const allAccounts = all.then(all => all.childAccounts.map(__item => __item.euuid));
export const filteredAccounts = filtered.then(filtered => filtered.childAccounts.map(__item => __item.euuid));
import pulumi
import pulumi_linode as linode
all = linode.get_child_accounts()
filtered = linode.get_child_accounts(filters=[
{
"name": "email",
"values": ["example@linode.com"],
},
{
"name": "first_name",
"values": ["John"],
},
{
"name": "last_name",
"values": ["Smith"],
},
])
pulumi.export("allAccounts", [__item.euuid for __item in all.child_accounts])
pulumi.export("filteredAccounts", [__item.euuid for __item in filtered.child_accounts])
package main
import (
"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
all, err := linode.GetChildAccounts(ctx, &linode.GetChildAccountsArgs{
}, nil);
if err != nil {
return err
}
filtered, err := linode.GetChildAccounts(ctx, &linode.GetChildAccountsArgs{
Filters: []linode.GetChildAccountsFilter{
{
Name: "email",
Values: []string{
"example@linode.com",
},
},
{
Name: "first_name",
Values: []string{
"John",
},
},
{
Name: "last_name",
Values: []string{
"Smith",
},
},
},
}, nil);
if err != nil {
return err
}
ctx.Export("allAccounts", pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:16,11-37)))
ctx.Export("filteredAccounts", pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:20,11-42)))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;
return await Deployment.RunAsync(() =>
{
var all = Linode.GetChildAccounts.Invoke();
var filtered = Linode.GetChildAccounts.Invoke(new()
{
Filters = new[]
{
new Linode.Inputs.GetChildAccountsFilterInputArgs
{
Name = "email",
Values = new[]
{
"example@linode.com",
},
},
new Linode.Inputs.GetChildAccountsFilterInputArgs
{
Name = "first_name",
Values = new[]
{
"John",
},
},
new Linode.Inputs.GetChildAccountsFilterInputArgs
{
Name = "last_name",
Values = new[]
{
"Smith",
},
},
},
});
return new Dictionary<string, object?>
{
["allAccounts"] = all.Apply(getChildAccountsResult => getChildAccountsResult.ChildAccounts).Select(__item => __item.Euuid).ToList(),
["filteredAccounts"] = filtered.Apply(getChildAccountsResult => getChildAccountsResult.ChildAccounts).Select(__item => __item.Euuid).ToList(),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.linode.LinodeFunctions;
import com.pulumi.linode.inputs.GetChildAccountsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var all = LinodeFunctions.getChildAccounts(GetChildAccountsArgs.builder()
.build());
final var filtered = LinodeFunctions.getChildAccounts(GetChildAccountsArgs.builder()
.filters(
GetChildAccountsFilterArgs.builder()
.name("email")
.values("example@linode.com")
.build(),
GetChildAccountsFilterArgs.builder()
.name("first_name")
.values("John")
.build(),
GetChildAccountsFilterArgs.builder()
.name("last_name")
.values("Smith")
.build())
.build());
ctx.export("allAccounts", all.childAccounts().stream().map(element -> element.euuid()).collect(toList()));
ctx.export("filteredAccounts", filtered.childAccounts().stream().map(element -> element.euuid()).collect(toList()));
}
}
Coming soon!
Filterable Fields
euuid
email
first_name
last_name
company
address_1
address_2
phone
city
state
country
zip
capabilities
active_since
Using getChildAccounts
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getChildAccounts(args: GetChildAccountsArgs, opts?: InvokeOptions): Promise<GetChildAccountsResult>
function getChildAccountsOutput(args: GetChildAccountsOutputArgs, opts?: InvokeOptions): Output<GetChildAccountsResult>
def get_child_accounts(child_accounts: Optional[Sequence[GetChildAccountsChildAccount]] = None,
filters: Optional[Sequence[GetChildAccountsFilter]] = None,
opts: Optional[InvokeOptions] = None) -> GetChildAccountsResult
def get_child_accounts_output(child_accounts: Optional[pulumi.Input[Sequence[pulumi.Input[GetChildAccountsChildAccountArgs]]]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetChildAccountsFilterArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetChildAccountsResult]
func GetChildAccounts(ctx *Context, args *GetChildAccountsArgs, opts ...InvokeOption) (*GetChildAccountsResult, error)
func GetChildAccountsOutput(ctx *Context, args *GetChildAccountsOutputArgs, opts ...InvokeOption) GetChildAccountsResultOutput
> Note: This function is named GetChildAccounts
in the Go SDK.
public static class GetChildAccounts
{
public static Task<GetChildAccountsResult> InvokeAsync(GetChildAccountsArgs args, InvokeOptions? opts = null)
public static Output<GetChildAccountsResult> Invoke(GetChildAccountsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetChildAccountsResult> getChildAccounts(GetChildAccountsArgs args, InvokeOptions options)
public static Output<GetChildAccountsResult> getChildAccounts(GetChildAccountsArgs args, InvokeOptions options)
fn::invoke:
function: linode:index/getChildAccounts:getChildAccounts
arguments:
# arguments dictionary
The following arguments are supported:
getChildAccounts Result
The following output properties are available:
Supporting Types
GetChildAccountsChildAccount
- Active
Since This property is required. string - When this account was first activated
- Address1
This property is required. string - First line of this Account's billing address.
- Address2
This property is required. string - Second line of this Account's billing address.
- Balance
This property is required. double - This Account's balance, in US dollars.
- Capabilities
This property is required. List<string> - A set containing all the capabilities of this Account.
- City
This property is required. string - The city for this Account's billing address.
- Company
This property is required. string - The company name associated with this Account.
- Country
This property is required. string - The two-letter country code of this Account's billing address.
- Email
This property is required. string - The email address for this Account, for account management communications, and may be used for other communications as configured.
- Euuid
This property is required. string - The unique ID of this Account.
- First
Name This property is required. string - The first name of the person associated with this Account.
- Id
This property is required. string - The Email of the Account.
- Last
Name This property is required. string - The last name of the person associated with this Account.
- Phone
This property is required. string - The phone number associated with this Account.
- State
This property is required. string - If billing address is in the United States, this is the State portion of the Account's billing address. If the address is outside the US, this is the Province associated with the Account's billing address.
- Zip
This property is required. string - The zip code of this Account's billing address.
- Active
Since This property is required. string - When this account was first activated
- Address1
This property is required. string - First line of this Account's billing address.
- Address2
This property is required. string - Second line of this Account's billing address.
- Balance
This property is required. float64 - This Account's balance, in US dollars.
- Capabilities
This property is required. []string - A set containing all the capabilities of this Account.
- City
This property is required. string - The city for this Account's billing address.
- Company
This property is required. string - The company name associated with this Account.
- Country
This property is required. string - The two-letter country code of this Account's billing address.
- Email
This property is required. string - The email address for this Account, for account management communications, and may be used for other communications as configured.
- Euuid
This property is required. string - The unique ID of this Account.
- First
Name This property is required. string - The first name of the person associated with this Account.
- Id
This property is required. string - The Email of the Account.
- Last
Name This property is required. string - The last name of the person associated with this Account.
- Phone
This property is required. string - The phone number associated with this Account.
- State
This property is required. string - If billing address is in the United States, this is the State portion of the Account's billing address. If the address is outside the US, this is the Province associated with the Account's billing address.
- Zip
This property is required. string - The zip code of this Account's billing address.
- active
Since This property is required. String - When this account was first activated
- address1
This property is required. String - First line of this Account's billing address.
- address2
This property is required. String - Second line of this Account's billing address.
- balance
This property is required. Double - This Account's balance, in US dollars.
- capabilities
This property is required. List<String> - A set containing all the capabilities of this Account.
- city
This property is required. String - The city for this Account's billing address.
- company
This property is required. String - The company name associated with this Account.
- country
This property is required. String - The two-letter country code of this Account's billing address.
- email
This property is required. String - The email address for this Account, for account management communications, and may be used for other communications as configured.
- euuid
This property is required. String - The unique ID of this Account.
- first
Name This property is required. String - The first name of the person associated with this Account.
- id
This property is required. String - The Email of the Account.
- last
Name This property is required. String - The last name of the person associated with this Account.
- phone
This property is required. String - The phone number associated with this Account.
- state
This property is required. String - If billing address is in the United States, this is the State portion of the Account's billing address. If the address is outside the US, this is the Province associated with the Account's billing address.
- zip
This property is required. String - The zip code of this Account's billing address.
- active
Since This property is required. string - When this account was first activated
- address1
This property is required. string - First line of this Account's billing address.
- address2
This property is required. string - Second line of this Account's billing address.
- balance
This property is required. number - This Account's balance, in US dollars.
- capabilities
This property is required. string[] - A set containing all the capabilities of this Account.
- city
This property is required. string - The city for this Account's billing address.
- company
This property is required. string - The company name associated with this Account.
- country
This property is required. string - The two-letter country code of this Account's billing address.
- email
This property is required. string - The email address for this Account, for account management communications, and may be used for other communications as configured.
- euuid
This property is required. string - The unique ID of this Account.
- first
Name This property is required. string - The first name of the person associated with this Account.
- id
This property is required. string - The Email of the Account.
- last
Name This property is required. string - The last name of the person associated with this Account.
- phone
This property is required. string - The phone number associated with this Account.
- state
This property is required. string - If billing address is in the United States, this is the State portion of the Account's billing address. If the address is outside the US, this is the Province associated with the Account's billing address.
- zip
This property is required. string - The zip code of this Account's billing address.
- active_
since This property is required. str - When this account was first activated
- address1
This property is required. str - First line of this Account's billing address.
- address2
This property is required. str - Second line of this Account's billing address.
- balance
This property is required. float - This Account's balance, in US dollars.
- capabilities
This property is required. Sequence[str] - A set containing all the capabilities of this Account.
- city
This property is required. str - The city for this Account's billing address.
- company
This property is required. str - The company name associated with this Account.
- country
This property is required. str - The two-letter country code of this Account's billing address.
- email
This property is required. str - The email address for this Account, for account management communications, and may be used for other communications as configured.
- euuid
This property is required. str - The unique ID of this Account.
- first_
name This property is required. str - The first name of the person associated with this Account.
- id
This property is required. str - The Email of the Account.
- last_
name This property is required. str - The last name of the person associated with this Account.
- phone
This property is required. str - The phone number associated with this Account.
- state
This property is required. str - If billing address is in the United States, this is the State portion of the Account's billing address. If the address is outside the US, this is the Province associated with the Account's billing address.
- zip
This property is required. str - The zip code of this Account's billing address.
- active
Since This property is required. String - When this account was first activated
- address1
This property is required. String - First line of this Account's billing address.
- address2
This property is required. String - Second line of this Account's billing address.
- balance
This property is required. Number - This Account's balance, in US dollars.
- capabilities
This property is required. List<String> - A set containing all the capabilities of this Account.
- city
This property is required. String - The city for this Account's billing address.
- company
This property is required. String - The company name associated with this Account.
- country
This property is required. String - The two-letter country code of this Account's billing address.
- email
This property is required. String - The email address for this Account, for account management communications, and may be used for other communications as configured.
- euuid
This property is required. String - The unique ID of this Account.
- first
Name This property is required. String - The first name of the person associated with this Account.
- id
This property is required. String - The Email of the Account.
- last
Name This property is required. String - The last name of the person associated with this Account.
- phone
This property is required. String - The phone number associated with this Account.
- state
This property is required. String - If billing address is in the United States, this is the State portion of the Account's billing address. If the address is outside the US, this is the Province associated with the Account's billing address.
- zip
This property is required. String - The zip code of this Account's billing address.
GetChildAccountsFilter
- Name
This property is required. string - The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- Values
This property is required. List<string> - A list of values for the filter to allow. These values should all be in string form.
- Match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- Name
This property is required. string - The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- Values
This property is required. []string - A list of values for the filter to allow. These values should all be in string form.
- Match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- name
This property is required. String - The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values
This property is required. List<String> - A list of values for the filter to allow. These values should all be in string form.
- match
By String - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- name
This property is required. string - The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values
This property is required. string[] - A list of values for the filter to allow. These values should all be in string form.
- match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- name
This property is required. str - The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values
This property is required. Sequence[str] - A list of values for the filter to allow. These values should all be in string form.
- match_
by str - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- name
This property is required. String - The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values
This property is required. List<String> - A list of values for the filter to allow. These values should all be in string form.
- match
By String - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
Package Details
- Repository
- Linode pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linode
Terraform Provider.