1. Packages
  2. Packages
  3. Opentelekomcloud Provider
  4. API Docs
  5. getSwrPolicyV2
Viewing docs for opentelekomcloud 1.36.64
published on Thursday, Apr 23, 2026 by opentelekomcloud
Viewing docs for opentelekomcloud 1.36.64
published on Thursday, Apr 23, 2026 by opentelekomcloud

    Up-to-date reference of API arguments for SWR image retention policy you can get at documentation portal

    Get details of an SWR image retention policy resource within Open Telekom Cloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const config = new pulumi.Config();
    const orgName = config.requireObject<any>("orgName");
    const repoName = config.requireObject<any>("repoName");
    const policyId = config.requireObject<any>("policyId");
    const policy1 = opentelekomcloud.getSwrPolicyV2({
        organization: orgName,
        repository: repoName,
        policyId: policyId,
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    config = pulumi.Config()
    org_name = config.require_object("orgName")
    repo_name = config.require_object("repoName")
    policy_id = config.require_object("policyId")
    policy1 = opentelekomcloud.get_swr_policy_v2(organization=org_name,
        repository=repo_name,
        policy_id=policy_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		orgName := cfg.RequireObject("orgName")
    		repoName := cfg.RequireObject("repoName")
    		policyId := cfg.RequireObject("policyId")
    		_, err := opentelekomcloud.LookupSwrPolicyV2(ctx, &opentelekomcloud.LookupSwrPolicyV2Args{
    			Organization: orgName,
    			Repository:   repoName,
    			PolicyId:     policyId,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opentelekomcloud = Pulumi.Opentelekomcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var orgName = config.RequireObject<dynamic>("orgName");
        var repoName = config.RequireObject<dynamic>("repoName");
        var policyId = config.RequireObject<dynamic>("policyId");
        var policy1 = Opentelekomcloud.GetSwrPolicyV2.Invoke(new()
        {
            Organization = orgName,
            Repository = repoName,
            PolicyId = policyId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opentelekomcloud.OpentelekomcloudFunctions;
    import com.pulumi.opentelekomcloud.inputs.GetSwrPolicyV2Args;
    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 config = ctx.config();
            final var orgName = config.get("orgName");
            final var repoName = config.get("repoName");
            final var policyId = config.get("policyId");
            final var policy1 = OpentelekomcloudFunctions.getSwrPolicyV2(GetSwrPolicyV2Args.builder()
                .organization(orgName)
                .repository(repoName)
                .policyId(policyId)
                .build());
    
        }
    }
    
    configuration:
      orgName:
        type: dynamic
      repoName:
        type: dynamic
      policyId:
        type: dynamic
    variables:
      policy1:
        fn::invoke:
          function: opentelekomcloud:getSwrPolicyV2
          arguments:
            organization: ${orgName}
            repository: ${repoName}
            policyId: ${policyId}
    

    Using getSwrPolicyV2

    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 getSwrPolicyV2(args: GetSwrPolicyV2Args, opts?: InvokeOptions): Promise<GetSwrPolicyV2Result>
    function getSwrPolicyV2Output(args: GetSwrPolicyV2OutputArgs, opts?: InvokeOptions): Output<GetSwrPolicyV2Result>
    def get_swr_policy_v2(id: Optional[str] = None,
                          organization: Optional[str] = None,
                          policy_id: Optional[str] = None,
                          repository: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetSwrPolicyV2Result
    def get_swr_policy_v2_output(id: Optional[pulumi.Input[str]] = None,
                          organization: Optional[pulumi.Input[str]] = None,
                          policy_id: Optional[pulumi.Input[str]] = None,
                          repository: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetSwrPolicyV2Result]
    func LookupSwrPolicyV2(ctx *Context, args *LookupSwrPolicyV2Args, opts ...InvokeOption) (*LookupSwrPolicyV2Result, error)
    func LookupSwrPolicyV2Output(ctx *Context, args *LookupSwrPolicyV2OutputArgs, opts ...InvokeOption) LookupSwrPolicyV2ResultOutput

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

    public static class GetSwrPolicyV2 
    {
        public static Task<GetSwrPolicyV2Result> InvokeAsync(GetSwrPolicyV2Args args, InvokeOptions? opts = null)
        public static Output<GetSwrPolicyV2Result> Invoke(GetSwrPolicyV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSwrPolicyV2Result> getSwrPolicyV2(GetSwrPolicyV2Args args, InvokeOptions options)
    public static Output<GetSwrPolicyV2Result> getSwrPolicyV2(GetSwrPolicyV2Args args, InvokeOptions options)
    
    fn::invoke:
      function: opentelekomcloud:index/getSwrPolicyV2:getSwrPolicyV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Organization string
    Specifies the name of the repository organization.
    PolicyId string
    Specifies the ID of the SWR policy.
    Repository string
    Specifies the name of the image repository.
    Id string
    Organization string
    Specifies the name of the repository organization.
    PolicyId string
    Specifies the ID of the SWR policy.
    Repository string
    Specifies the name of the image repository.
    Id string
    organization String
    Specifies the name of the repository organization.
    policyId String
    Specifies the ID of the SWR policy.
    repository String
    Specifies the name of the image repository.
    id String
    organization string
    Specifies the name of the repository organization.
    policyId string
    Specifies the ID of the SWR policy.
    repository string
    Specifies the name of the image repository.
    id string
    organization str
    Specifies the name of the repository organization.
    policy_id str
    Specifies the ID of the SWR policy.
    repository str
    Specifies the name of the image repository.
    id str
    organization String
    Specifies the name of the repository organization.
    policyId String
    Specifies the ID of the SWR policy.
    repository String
    Specifies the name of the image repository.
    id String

    getSwrPolicyV2 Result

    The following output properties are available:

    Algorithm string
    The image retention policy matching rule.
    Id string
    Organization string
    PolicyId string
    Repository string
    Rules List<GetSwrPolicyV2Rule>
    The image retention policy. The rules structure is documented below.
    Scope string
    Algorithm string
    The image retention policy matching rule.
    Id string
    Organization string
    PolicyId string
    Repository string
    Rules []GetSwrPolicyV2Rule
    The image retention policy. The rules structure is documented below.
    Scope string
    algorithm String
    The image retention policy matching rule.
    id String
    organization String
    policyId String
    repository String
    rules List<GetSwrPolicyV2Rule>
    The image retention policy. The rules structure is documented below.
    scope String
    algorithm string
    The image retention policy matching rule.
    id string
    organization string
    policyId string
    repository string
    rules GetSwrPolicyV2Rule[]
    The image retention policy. The rules structure is documented below.
    scope string
    algorithm str
    The image retention policy matching rule.
    id str
    organization str
    policy_id str
    repository str
    rules Sequence[GetSwrPolicyV2Rule]
    The image retention policy. The rules structure is documented below.
    scope str
    algorithm String
    The image retention policy matching rule.
    id String
    organization String
    policyId String
    repository String
    rules List<Property Map>
    The image retention policy. The rules structure is documented below.
    scope String

    Supporting Types

    GetSwrPolicyV2Rule

    Params Dictionary<string, string>
    The image retention policy parameters.
    TagSelectors List<GetSwrPolicyV2RuleTagSelector>
    The exception images. The structure is documented below.
    Template string
    The image retention policy type.
    Params map[string]string
    The image retention policy parameters.
    TagSelectors []GetSwrPolicyV2RuleTagSelector
    The exception images. The structure is documented below.
    Template string
    The image retention policy type.
    params Map<String,String>
    The image retention policy parameters.
    tagSelectors List<GetSwrPolicyV2RuleTagSelector>
    The exception images. The structure is documented below.
    template String
    The image retention policy type.
    params {[key: string]: string}
    The image retention policy parameters.
    tagSelectors GetSwrPolicyV2RuleTagSelector[]
    The exception images. The structure is documented below.
    template string
    The image retention policy type.
    params Mapping[str, str]
    The image retention policy parameters.
    tag_selectors Sequence[GetSwrPolicyV2RuleTagSelector]
    The exception images. The structure is documented below.
    template str
    The image retention policy type.
    params Map<String>
    The image retention policy parameters.
    tagSelectors List<Property Map>
    The exception images. The structure is documented below.
    template String
    The image retention policy type.

    GetSwrPolicyV2RuleTagSelector

    Kind string
    The matching rule.
    Pattern string
    The matching rule value.
    Kind string
    The matching rule.
    Pattern string
    The matching rule value.
    kind String
    The matching rule.
    pattern String
    The matching rule value.
    kind string
    The matching rule.
    pattern string
    The matching rule value.
    kind str
    The matching rule.
    pattern str
    The matching rule value.
    kind String
    The matching rule.
    pattern String
    The matching rule value.

    Package Details

    Repository
    opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
    License
    Notes
    This Pulumi package is based on the opentelekomcloud Terraform Provider.
    Viewing docs for opentelekomcloud 1.36.64
    published on Thursday, Apr 23, 2026 by opentelekomcloud
      Try Pulumi Cloud free. Your team will thank you.