1. Packages
  2. UpCloud
  3. API Docs
  4. getManagedDatabaseRedisSessions
UpCloud v0.2.0 published on Wednesday, Apr 16, 2025 by UpCloudLtd

upcloud.getManagedDatabaseRedisSessions

Explore with Pulumi AI

Redis is deprecated in favor of Valkey. Please use Valkey for new key value store instances.

Current sessions of a Redis managed database

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as upcloud from "@pulumi/upcloud";
import * as upcloud from "@upcloud/pulumi-upcloud";

// Use data source to gather a list of the active sessions for a Managed Redis Database
// Create a Managed Redis resource
const exampleManagedDatabaseRedis = new upcloud.ManagedDatabaseRedis("example", {
    name: "example",
    title: "example",
    plan: "1x1xCPU-2GB",
    zone: "fi-hel2",
});
// Read the active sessions of the newly created service
const example = upcloud.getManagedDatabaseRedisSessionsOutput({
    service: exampleManagedDatabaseRedis.id,
});
Copy
import pulumi
import pulumi_upcloud as upcloud

# Use data source to gather a list of the active sessions for a Managed Redis Database
# Create a Managed Redis resource
example_managed_database_redis = upcloud.ManagedDatabaseRedis("example",
    name="example",
    title="example",
    plan="1x1xCPU-2GB",
    zone="fi-hel2")
# Read the active sessions of the newly created service
example = upcloud.get_managed_database_redis_sessions_output(service=example_managed_database_redis.id)
Copy
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 Redis Database
		// Create a Managed Redis resource
		exampleManagedDatabaseRedis, err := upcloud.NewManagedDatabaseRedis(ctx, "example", &upcloud.ManagedDatabaseRedisArgs{
			Name:  pulumi.String("example"),
			Title: pulumi.String("example"),
			Plan:  pulumi.String("1x1xCPU-2GB"),
			Zone:  pulumi.String("fi-hel2"),
		})
		if err != nil {
			return err
		}
		// Read the active sessions of the newly created service
		_ = upcloud.GetManagedDatabaseRedisSessionsOutput(ctx, upcloud.GetManagedDatabaseRedisSessionsOutputArgs{
			Service: exampleManagedDatabaseRedis.ID(),
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using UpCloud = Pulumi.UpCloud;
using UpCloud = UpCloud.Pulumi.UpCloud;

return await Deployment.RunAsync(() => 
{
    // Use data source to gather a list of the active sessions for a Managed Redis Database
    // Create a Managed Redis resource
    var exampleManagedDatabaseRedis = new UpCloud.ManagedDatabaseRedis("example", new()
    {
        Name = "example",
        Title = "example",
        Plan = "1x1xCPU-2GB",
        Zone = "fi-hel2",
    });

    // Read the active sessions of the newly created service
    var example = UpCloud.GetManagedDatabaseRedisSessions.Invoke(new()
    {
        Service = exampleManagedDatabaseRedis.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.upcloud.ManagedDatabaseRedis;
import com.pulumi.upcloud.ManagedDatabaseRedisArgs;
import com.pulumi.upcloud.UpcloudFunctions;
import com.pulumi.upcloud.inputs.GetManagedDatabaseRedisSessionsArgs;
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 Redis Database
        // Create a Managed Redis resource
        var exampleManagedDatabaseRedis = new ManagedDatabaseRedis("exampleManagedDatabaseRedis", ManagedDatabaseRedisArgs.builder()
            .name("example")
            .title("example")
            .plan("1x1xCPU-2GB")
            .zone("fi-hel2")
            .build());

        // Read the active sessions of the newly created service
        final var example = UpcloudFunctions.getManagedDatabaseRedisSessions(GetManagedDatabaseRedisSessionsArgs.builder()
            .service(exampleManagedDatabaseRedis.id())
            .build());

    }
}
Copy
resources:
  # Use data source to gather a list of the active sessions for a Managed Redis Database

  # Create a Managed Redis resource
  exampleManagedDatabaseRedis:
    type: upcloud:ManagedDatabaseRedis
    name: example
    properties:
      name: example
      title: example
      plan: 1x1xCPU-2GB
      zone: fi-hel2
variables:
  # Read the active sessions of the newly created service
  example:
    fn::invoke:
      function: upcloud:getManagedDatabaseRedisSessions
      arguments:
        service: ${exampleManagedDatabaseRedis.id}
Copy

Using getManagedDatabaseRedisSessions

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 getManagedDatabaseRedisSessions(args: GetManagedDatabaseRedisSessionsArgs, opts?: InvokeOptions): Promise<GetManagedDatabaseRedisSessionsResult>
function getManagedDatabaseRedisSessionsOutput(args: GetManagedDatabaseRedisSessionsOutputArgs, opts?: InvokeOptions): Output<GetManagedDatabaseRedisSessionsResult>
Copy
def get_managed_database_redis_sessions(limit: Optional[int] = None,
                                        offset: Optional[int] = None,
                                        order: Optional[str] = None,
                                        service: Optional[str] = None,
                                        sessions: Optional[Sequence[GetManagedDatabaseRedisSessionsSession]] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetManagedDatabaseRedisSessionsResult
def get_managed_database_redis_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[GetManagedDatabaseRedisSessionsSessionArgs]]]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetManagedDatabaseRedisSessionsResult]
Copy
func GetManagedDatabaseRedisSessions(ctx *Context, args *GetManagedDatabaseRedisSessionsArgs, opts ...InvokeOption) (*GetManagedDatabaseRedisSessionsResult, error)
func GetManagedDatabaseRedisSessionsOutput(ctx *Context, args *GetManagedDatabaseRedisSessionsOutputArgs, opts ...InvokeOption) GetManagedDatabaseRedisSessionsResultOutput
Copy

> Note: This function is named GetManagedDatabaseRedisSessions in the Go SDK.

public static class GetManagedDatabaseRedisSessions 
{
    public static Task<GetManagedDatabaseRedisSessionsResult> InvokeAsync(GetManagedDatabaseRedisSessionsArgs args, InvokeOptions? opts = null)
    public static Output<GetManagedDatabaseRedisSessionsResult> Invoke(GetManagedDatabaseRedisSessionsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetManagedDatabaseRedisSessionsResult> getManagedDatabaseRedisSessions(GetManagedDatabaseRedisSessionsArgs args, InvokeOptions options)
public static Output<GetManagedDatabaseRedisSessionsResult> getManagedDatabaseRedisSessions(GetManagedDatabaseRedisSessionsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: upcloud:index/getManagedDatabaseRedisSessions:getManagedDatabaseRedisSessions
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Service This property is required. string
Limit int
Offset int
Order string
Sessions []GetManagedDatabaseRedisSessionsSession
service This property is required. String
limit Integer
offset Integer
order String
sessions List<GetManagedDatabaseRedisSessionsSession>
service This property is required. string
limit number
offset number
order string
sessions GetManagedDatabaseRedisSessionsSession[]
service This property is required. String
limit Number
offset Number
order String
sessions List<Property Map>

getManagedDatabaseRedisSessions Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Service string
Sessions List<UpCloud.Pulumi.UpCloud.Outputs.GetManagedDatabaseRedisSessionsSession>
Limit int
Offset int
Order string
Id string
The provider-assigned unique ID for this managed resource.
Service string
Sessions []GetManagedDatabaseRedisSessionsSession
Limit int
Offset int
Order string
id String
The provider-assigned unique ID for this managed resource.
service String
sessions List<GetManagedDatabaseRedisSessionsSession>
limit Integer
offset Integer
order String
id string
The provider-assigned unique ID for this managed resource.
service string
sessions GetManagedDatabaseRedisSessionsSession[]
limit number
offset number
order string
id str
The provider-assigned unique ID for this managed resource.
service str
sessions Sequence[GetManagedDatabaseRedisSessionsSession]
limit int
offset int
order str
id String
The provider-assigned unique ID for this managed resource.
service String
sessions List<Property Map>
limit Number
offset Number
order String

Supporting Types

GetManagedDatabaseRedisSessionsSession

ActiveChannelSubscriptions This property is required. int
Number of active channel subscriptions
ActiveDatabase This property is required. string
Current database ID
ActivePatternMatchingChannelSubscriptions This property is required. int
Number of pattern matching subscriptions.
ApplicationName This property is required. string
Name of the application that is connected to this service.
ClientAddr This property is required. string
Number of pattern matching subscriptions.
ConnectionAge This property is required. int
Total duration of the connection in nanoseconds.
ConnectionIdle This property is required. int
Idle time of the connection in nanoseconds.
Flags This property is required. List<string>
A set containing flags' descriptions.
FlagsRaw This property is required. string
Client connection flags in raw string format.
Id This property is required. string
Process ID of this session.
MultiExecCommands This property is required. int
Number of commands in a MULTI/EXEC context.
OutputBuffer This property is required. int
Output buffer length.
OutputBufferMemory This property is required. int
Output buffer memory usage.
OutputListLength This property is required. int
Output list length (replies are queued in this list when the buffer is full).
Query This property is required. string
The last executed command.
QueryBuffer This property is required. int
Query buffer length (0 means no query pending).
QueryBufferFree This property is required. int
Free space of the query buffer (0 means the buffer is full).
ActiveChannelSubscriptions This property is required. int
Number of active channel subscriptions
ActiveDatabase This property is required. string
Current database ID
ActivePatternMatchingChannelSubscriptions This property is required. int
Number of pattern matching subscriptions.
ApplicationName This property is required. string
Name of the application that is connected to this service.
ClientAddr This property is required. string
Number of pattern matching subscriptions.
ConnectionAge This property is required. int
Total duration of the connection in nanoseconds.
ConnectionIdle This property is required. int
Idle time of the connection in nanoseconds.
Flags This property is required. []string
A set containing flags' descriptions.
FlagsRaw This property is required. string
Client connection flags in raw string format.
Id This property is required. string
Process ID of this session.
MultiExecCommands This property is required. int
Number of commands in a MULTI/EXEC context.
OutputBuffer This property is required. int
Output buffer length.
OutputBufferMemory This property is required. int
Output buffer memory usage.
OutputListLength This property is required. int
Output list length (replies are queued in this list when the buffer is full).
Query This property is required. string
The last executed command.
QueryBuffer This property is required. int
Query buffer length (0 means no query pending).
QueryBufferFree This property is required. int
Free space of the query buffer (0 means the buffer is full).
activeChannelSubscriptions This property is required. Integer
Number of active channel subscriptions
activeDatabase This property is required. String
Current database ID
activePatternMatchingChannelSubscriptions This property is required. Integer
Number of pattern matching subscriptions.
applicationName This property is required. String
Name of the application that is connected to this service.
clientAddr This property is required. String
Number of pattern matching subscriptions.
connectionAge This property is required. Integer
Total duration of the connection in nanoseconds.
connectionIdle This property is required. Integer
Idle time of the connection in nanoseconds.
flags This property is required. List<String>
A set containing flags' descriptions.
flagsRaw This property is required. String
Client connection flags in raw string format.
id This property is required. String
Process ID of this session.
multiExecCommands This property is required. Integer
Number of commands in a MULTI/EXEC context.
outputBuffer This property is required. Integer
Output buffer length.
outputBufferMemory This property is required. Integer
Output buffer memory usage.
outputListLength This property is required. Integer
Output list length (replies are queued in this list when the buffer is full).
query This property is required. String
The last executed command.
queryBuffer This property is required. Integer
Query buffer length (0 means no query pending).
queryBufferFree This property is required. Integer
Free space of the query buffer (0 means the buffer is full).
activeChannelSubscriptions This property is required. number
Number of active channel subscriptions
activeDatabase This property is required. string
Current database ID
activePatternMatchingChannelSubscriptions This property is required. number
Number of pattern matching subscriptions.
applicationName This property is required. string
Name of the application that is connected to this service.
clientAddr This property is required. string
Number of pattern matching subscriptions.
connectionAge This property is required. number
Total duration of the connection in nanoseconds.
connectionIdle This property is required. number
Idle time of the connection in nanoseconds.
flags This property is required. string[]
A set containing flags' descriptions.
flagsRaw This property is required. string
Client connection flags in raw string format.
id This property is required. string
Process ID of this session.
multiExecCommands This property is required. number
Number of commands in a MULTI/EXEC context.
outputBuffer This property is required. number
Output buffer length.
outputBufferMemory This property is required. number
Output buffer memory usage.
outputListLength This property is required. number
Output list length (replies are queued in this list when the buffer is full).
query This property is required. string
The last executed command.
queryBuffer This property is required. number
Query buffer length (0 means no query pending).
queryBufferFree This property is required. number
Free space of the query buffer (0 means the buffer is full).
active_channel_subscriptions This property is required. int
Number of active channel subscriptions
active_database This property is required. str
Current database ID
active_pattern_matching_channel_subscriptions This property is required. int
Number of pattern matching subscriptions.
application_name This property is required. str
Name of the application that is connected to this service.
client_addr This property is required. str
Number of pattern matching subscriptions.
connection_age This property is required. int
Total duration of the connection in nanoseconds.
connection_idle This property is required. int
Idle time of the connection in nanoseconds.
flags This property is required. Sequence[str]
A set containing flags' descriptions.
flags_raw This property is required. str
Client connection flags in raw string format.
id This property is required. str
Process ID of this session.
multi_exec_commands This property is required. int
Number of commands in a MULTI/EXEC context.
output_buffer This property is required. int
Output buffer length.
output_buffer_memory This property is required. int
Output buffer memory usage.
output_list_length This property is required. int
Output list length (replies are queued in this list when the buffer is full).
query This property is required. str
The last executed command.
query_buffer This property is required. int
Query buffer length (0 means no query pending).
query_buffer_free This property is required. int
Free space of the query buffer (0 means the buffer is full).
activeChannelSubscriptions This property is required. Number
Number of active channel subscriptions
activeDatabase This property is required. String
Current database ID
activePatternMatchingChannelSubscriptions This property is required. Number
Number of pattern matching subscriptions.
applicationName This property is required. String
Name of the application that is connected to this service.
clientAddr This property is required. String
Number of pattern matching subscriptions.
connectionAge This property is required. Number
Total duration of the connection in nanoseconds.
connectionIdle This property is required. Number
Idle time of the connection in nanoseconds.
flags This property is required. List<String>
A set containing flags' descriptions.
flagsRaw This property is required. String
Client connection flags in raw string format.
id This property is required. String
Process ID of this session.
multiExecCommands This property is required. Number
Number of commands in a MULTI/EXEC context.
outputBuffer This property is required. Number
Output buffer length.
outputBufferMemory This property is required. Number
Output buffer memory usage.
outputListLength This property is required. Number
Output list length (replies are queued in this list when the buffer is full).
query This property is required. String
The last executed command.
queryBuffer This property is required. Number
Query buffer length (0 means no query pending).
queryBufferFree This property is required. Number
Free space of the query buffer (0 means the buffer is full).

Package Details

Repository
upcloud UpCloudLtd/pulumi-upcloud
License
Apache-2.0
Notes
This Pulumi package is based on the upcloud Terraform Provider.