Viewing docs for UpCloud v0.12.1
published on Friday, Mar 27, 2026 by UpCloudLtd
published on Friday, Mar 27, 2026 by UpCloudLtd
Viewing docs for UpCloud v0.12.1
published on Friday, Mar 27, 2026 by UpCloudLtd
published on Friday, Mar 27, 2026 by UpCloudLtd
Current sessions of a MySQL managed database
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as upcloud from "@upcloud/pulumi-upcloud";
// Use data source to gather a list of the active sessions for a Managed MySQL Database
// Create a Managed MySQL resource
const exampleManagedDatabaseMysql = new upcloud.ManagedDatabaseMysql("example", {
name: "mysql-example1",
title: "mysql-example1",
plan: "1x1xCPU-2GB-25GB",
zone: "fi-hel1",
});
// Read the active sessions of the newly created service
const example = upcloud.getManagedDatabaseMysqlSessionsOutput({
service: exampleManagedDatabaseMysql.id,
});
import pulumi
import pulumi_upcloud as upcloud
# Use data source to gather a list of the active sessions for a Managed MySQL Database
# Create a Managed MySQL resource
example_managed_database_mysql = upcloud.ManagedDatabaseMysql("example",
name="mysql-example1",
title="mysql-example1",
plan="1x1xCPU-2GB-25GB",
zone="fi-hel1")
# Read the active sessions of the newly created service
example = upcloud.get_managed_database_mysql_sessions_output(service=example_managed_database_mysql.id)
package main
import (
"github.com/UpCloudLtd/pulumi-upcloud/sdk/go/upcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Use data source to gather a list of the active sessions for a Managed MySQL Database
// Create a Managed MySQL resource
exampleManagedDatabaseMysql, err := upcloud.NewManagedDatabaseMysql(ctx, "example", &upcloud.ManagedDatabaseMysqlArgs{
Name: pulumi.String("mysql-example1"),
Title: pulumi.String("mysql-example1"),
Plan: pulumi.String("1x1xCPU-2GB-25GB"),
Zone: pulumi.String("fi-hel1"),
})
if err != nil {
return err
}
// Read the active sessions of the newly created service
_ = upcloud.GetManagedDatabaseMysqlSessionsOutput(ctx, upcloud.GetManagedDatabaseMysqlSessionsOutputArgs{
Service: exampleManagedDatabaseMysql.ID(),
}, nil)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using UpCloud = UpCloud.Pulumi.UpCloud;
return await Deployment.RunAsync(() =>
{
// Use data source to gather a list of the active sessions for a Managed MySQL Database
// Create a Managed MySQL resource
var exampleManagedDatabaseMysql = new UpCloud.ManagedDatabaseMysql("example", new()
{
Name = "mysql-example1",
Title = "mysql-example1",
Plan = "1x1xCPU-2GB-25GB",
Zone = "fi-hel1",
});
// Read the active sessions of the newly created service
var example = UpCloud.GetManagedDatabaseMysqlSessions.Invoke(new()
{
Service = exampleManagedDatabaseMysql.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.upcloud.ManagedDatabaseMysql;
import com.pulumi.upcloud.ManagedDatabaseMysqlArgs;
import com.pulumi.upcloud.UpcloudFunctions;
import com.pulumi.upcloud.inputs.GetManagedDatabaseMysqlSessionsArgs;
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) {
// Use data source to gather a list of the active sessions for a Managed MySQL Database
// Create a Managed MySQL resource
var exampleManagedDatabaseMysql = new ManagedDatabaseMysql("exampleManagedDatabaseMysql", ManagedDatabaseMysqlArgs.builder()
.name("mysql-example1")
.title("mysql-example1")
.plan("1x1xCPU-2GB-25GB")
.zone("fi-hel1")
.build());
// Read the active sessions of the newly created service
final var example = UpcloudFunctions.getManagedDatabaseMysqlSessions(GetManagedDatabaseMysqlSessionsArgs.builder()
.service(exampleManagedDatabaseMysql.id())
.build());
}
}
resources:
# Use data source to gather a list of the active sessions for a Managed MySQL Database
# Create a Managed MySQL resource
exampleManagedDatabaseMysql:
type: upcloud:ManagedDatabaseMysql
name: example
properties:
name: mysql-example1
title: mysql-example1
plan: 1x1xCPU-2GB-25GB
zone: fi-hel1
variables:
# Read the active sessions of the newly created service
example:
fn::invoke:
function: upcloud:getManagedDatabaseMysqlSessions
arguments:
service: ${exampleManagedDatabaseMysql.id}
Using getManagedDatabaseMysqlSessions
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 getManagedDatabaseMysqlSessions(args: GetManagedDatabaseMysqlSessionsArgs, opts?: InvokeOptions): Promise<GetManagedDatabaseMysqlSessionsResult>
function getManagedDatabaseMysqlSessionsOutput(args: GetManagedDatabaseMysqlSessionsOutputArgs, opts?: InvokeOptions): Output<GetManagedDatabaseMysqlSessionsResult>def get_managed_database_mysql_sessions(limit: Optional[int] = None,
offset: Optional[int] = None,
order: Optional[str] = None,
service: Optional[str] = None,
sessions: Optional[Sequence[GetManagedDatabaseMysqlSessionsSession]] = None,
opts: Optional[InvokeOptions] = None) -> GetManagedDatabaseMysqlSessionsResult
def get_managed_database_mysql_sessions_output(limit: Optional[pulumi.Input[int]] = None,
offset: Optional[pulumi.Input[int]] = None,
order: Optional[pulumi.Input[str]] = None,
service: Optional[pulumi.Input[str]] = None,
sessions: Optional[pulumi.Input[Sequence[pulumi.Input[GetManagedDatabaseMysqlSessionsSessionArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetManagedDatabaseMysqlSessionsResult]func GetManagedDatabaseMysqlSessions(ctx *Context, args *GetManagedDatabaseMysqlSessionsArgs, opts ...InvokeOption) (*GetManagedDatabaseMysqlSessionsResult, error)
func GetManagedDatabaseMysqlSessionsOutput(ctx *Context, args *GetManagedDatabaseMysqlSessionsOutputArgs, opts ...InvokeOption) GetManagedDatabaseMysqlSessionsResultOutput> Note: This function is named GetManagedDatabaseMysqlSessions in the Go SDK.
public static class GetManagedDatabaseMysqlSessions
{
public static Task<GetManagedDatabaseMysqlSessionsResult> InvokeAsync(GetManagedDatabaseMysqlSessionsArgs args, InvokeOptions? opts = null)
public static Output<GetManagedDatabaseMysqlSessionsResult> Invoke(GetManagedDatabaseMysqlSessionsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetManagedDatabaseMysqlSessionsResult> getManagedDatabaseMysqlSessions(GetManagedDatabaseMysqlSessionsArgs args, InvokeOptions options)
public static Output<GetManagedDatabaseMysqlSessionsResult> getManagedDatabaseMysqlSessions(GetManagedDatabaseMysqlSessionsArgs args, InvokeOptions options)
fn::invoke:
function: upcloud:index/getManagedDatabaseMysqlSessions:getManagedDatabaseMysqlSessions
arguments:
# arguments dictionaryThe following arguments are supported:
getManagedDatabaseMysqlSessions Result
The following output properties are available:
Supporting Types
GetManagedDatabaseMysqlSessionsSession
- Application
Name string - Name of the application that is connected to this service.
- Client
Addr string - IP address of the client connected to this service.
- Datname string
- Name of the database this service is connected to.
- Id string
- Process ID of this service.
- Query string
- Text of this service's most recent query. If state is active this field shows the currently executing query. In all other states, it shows an empty string.
- Query
Duration string - The active query current duration.
- State string
- Current overall state of this service: active: The service is executing a query, idle: The service is waiting for a new client command.
- Usename string
- Name of the user logged into this service.
- Application
Name string - Name of the application that is connected to this service.
- Client
Addr string - IP address of the client connected to this service.
- Datname string
- Name of the database this service is connected to.
- Id string
- Process ID of this service.
- Query string
- Text of this service's most recent query. If state is active this field shows the currently executing query. In all other states, it shows an empty string.
- Query
Duration string - The active query current duration.
- State string
- Current overall state of this service: active: The service is executing a query, idle: The service is waiting for a new client command.
- Usename string
- Name of the user logged into this service.
- application
Name String - Name of the application that is connected to this service.
- client
Addr String - IP address of the client connected to this service.
- datname String
- Name of the database this service is connected to.
- id String
- Process ID of this service.
- query String
- Text of this service's most recent query. If state is active this field shows the currently executing query. In all other states, it shows an empty string.
- query
Duration String - The active query current duration.
- state String
- Current overall state of this service: active: The service is executing a query, idle: The service is waiting for a new client command.
- usename String
- Name of the user logged into this service.
- application
Name string - Name of the application that is connected to this service.
- client
Addr string - IP address of the client connected to this service.
- datname string
- Name of the database this service is connected to.
- id string
- Process ID of this service.
- query string
- Text of this service's most recent query. If state is active this field shows the currently executing query. In all other states, it shows an empty string.
- query
Duration string - The active query current duration.
- state string
- Current overall state of this service: active: The service is executing a query, idle: The service is waiting for a new client command.
- usename string
- Name of the user logged into this service.
- application_
name str - Name of the application that is connected to this service.
- client_
addr str - IP address of the client connected to this service.
- datname str
- Name of the database this service is connected to.
- id str
- Process ID of this service.
- query str
- Text of this service's most recent query. If state is active this field shows the currently executing query. In all other states, it shows an empty string.
- query_
duration str - The active query current duration.
- state str
- Current overall state of this service: active: The service is executing a query, idle: The service is waiting for a new client command.
- usename str
- Name of the user logged into this service.
- application
Name String - Name of the application that is connected to this service.
- client
Addr String - IP address of the client connected to this service.
- datname String
- Name of the database this service is connected to.
- id String
- Process ID of this service.
- query String
- Text of this service's most recent query. If state is active this field shows the currently executing query. In all other states, it shows an empty string.
- query
Duration String - The active query current duration.
- state String
- Current overall state of this service: active: The service is executing a query, idle: The service is waiting for a new client command.
- usename String
- Name of the user logged into this service.
Package Details
- Repository
- upcloud UpCloudLtd/pulumi-upcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
upcloudTerraform Provider.
Viewing docs for UpCloud v0.12.1
published on Friday, Mar 27, 2026 by UpCloudLtd
published on Friday, Mar 27, 2026 by UpCloudLtd
