1. Packages
  2. Routeros Provider
  3. API Docs
  4. getIpServices
routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros

routeros.getIpServices

Explore with Pulumi AI

routeros logo
routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as routeros from "@pulumi/routeros";
    
    export = async () => {
        const router = await routeros.getIpServices({});
        const router_disabled: routeros.IpService[] = [];
        for (const range of Object.entries(.filter(s => s.name != "www-ssl").reduce((__obj, s) => ({ ...__obj, [s.name]: s }))).map(([k, v]) => ({key: k, value: v}))) {
            router_disabled.push(new routeros.IpService(`router-disabled-${range.key}`, {
                disabled: true,
                numbers: range.value.name,
                port: range.value.port,
            }, {
            provider: routeros.router,
        }));
        }
    }
    
    import pulumi
    import pulumi_routeros as routeros
    
    router = routeros.get_ip_services()
    router_disabled = []
    for range in [{"key": k, "value": v} for [k, v] in enumerate({s.name: s for s in router.services if s.name != www-ssl})]:
        router_disabled.append(routeros.IpService(f"router-disabled-{range['key']}",
            disabled=True,
            numbers=range["value"],
            port=range["value"],
            opts = pulumi.ResourceOptions(provider=routeros["router"])))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/routeros/routeros"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		router, err := routeros.GetIpServices(ctx, &routeros.GetIpServicesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		var router_disabled []*routeros.IpService
    		for key0, val0 := range map[string]routeros.GetIpServicesService("TODO: For expression") {
    			__res, err := routeros.NewIpService(ctx, fmt.Sprintf("router-disabled-%v", key0), &routeros.IpServiceArgs{
    				Disabled: pulumi.Bool(true),
    				Numbers:  pulumi.String(val0),
    				Port:     pulumi.Float64(val0),
    			}, pulumi.Provider(routeros.Router))
    			if err != nil {
    				return err
    			}
    			router_disabled = append(router_disabled, __res)
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Pulumi;
    using Routeros = Pulumi.Routeros;
    
    return await Deployment.RunAsync(async() => 
    {
        var router = await Routeros.GetIpServices.InvokeAsync();
    
        var router_disabled = new List<Routeros.IpService>();
        foreach (var range in .Select(pair => new { pair.Key, pair.Value }))
        {
            router_disabled.Add(new Routeros.IpService($"router-disabled-{range.Key}", new()
            {
                Disabled = true,
                Numbers = range.Value.Name,
                Port = range.Value.Port,
            }, new CustomResourceOptions
            {
                Provider = routeros.Router,
            }));
        }
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.routeros.RouterosFunctions;
    import com.pulumi.routeros.inputs.GetIpServicesArgs;
    import com.pulumi.routeros.IpService;
    import com.pulumi.routeros.IpServiceArgs;
    import com.pulumi.codegen.internal.KeyedValue;
    import com.pulumi.resources.CustomResourceOptions;
    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 router = RouterosFunctions.getIpServices();
    
            for (var range : KeyedValue.of("TODO: ForExpression")) {
                new IpService("router-disabled-" + range.key(), IpServiceArgs.builder()
                    .disabled(true)
                    .numbers(range.value().name())
                    .port(range.value().port())
                    .build(), CustomResourceOptions.builder()
                        .provider(routeros.router())
                        .build());
            }
    
        }
    }
    
    resources:
      router-disabled:
        type: routeros:IpService
        properties:
          disabled: true
          numbers: ${range.value.name}
          port: ${range.value.port}
        options:
          provider: ${routeros.router}
    variables:
      router:
        fn::invoke:
          function: routeros:getIpServices
          arguments: {}
    

    Using getIpServices

    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 getIpServices(args: GetIpServicesArgs, opts?: InvokeOptions): Promise<GetIpServicesResult>
    function getIpServicesOutput(args: GetIpServicesOutputArgs, opts?: InvokeOptions): Output<GetIpServicesResult>
    def get_ip_services(___id_: Optional[float] = None,
                        ___path_: Optional[str] = None,
                        filter: Optional[Mapping[str, str]] = None,
                        id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetIpServicesResult
    def get_ip_services_output(___id_: Optional[pulumi.Input[float]] = None,
                        ___path_: Optional[pulumi.Input[str]] = None,
                        filter: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                        id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetIpServicesResult]
    func GetIpServices(ctx *Context, args *GetIpServicesArgs, opts ...InvokeOption) (*GetIpServicesResult, error)
    func GetIpServicesOutput(ctx *Context, args *GetIpServicesOutputArgs, opts ...InvokeOption) GetIpServicesResultOutput

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

    public static class GetIpServices 
    {
        public static Task<GetIpServicesResult> InvokeAsync(GetIpServicesArgs args, InvokeOptions? opts = null)
        public static Output<GetIpServicesResult> Invoke(GetIpServicesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIpServicesResult> getIpServices(GetIpServicesArgs args, InvokeOptions options)
    public static Output<GetIpServicesResult> getIpServices(GetIpServicesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: routeros:index/getIpServices:getIpServices
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filter Dictionary<string, string>
    Additional request filtering options.
    Id string
    The ID of this resource.
    ___id_ double
    ___path_ string
    Filter map[string]string
    Additional request filtering options.
    Id string
    The ID of this resource.
    ___id_ float64
    ___path_ string
    ___id_ Double
    ___path_ String
    filter Map<String,String>
    Additional request filtering options.
    id String
    The ID of this resource.
    ___id_ number
    ___path_ string
    filter {[key: string]: string}
    Additional request filtering options.
    id string
    The ID of this resource.
    ___id_ float
    ___path_ str
    filter Mapping[str, str]
    Additional request filtering options.
    id str
    The ID of this resource.
    ___id_ Number
    ___path_ String
    filter Map<String>
    Additional request filtering options.
    id String
    The ID of this resource.

    getIpServices Result

    The following output properties are available:

    Id string
    The ID of this resource.
    Services List<GetIpServicesService>
    Filter Dictionary<string, string>
    Additional request filtering options.
    ___id_ double
    ___path_ string
    Id string
    The ID of this resource.
    Services []GetIpServicesService
    Filter map[string]string
    Additional request filtering options.
    ___id_ float64
    ___path_ string
    id String
    The ID of this resource.
    services List<GetIpServicesService>
    ___id_ Double
    ___path_ String
    filter Map<String,String>
    Additional request filtering options.
    id string
    The ID of this resource.
    services GetIpServicesService[]
    ___id_ number
    ___path_ string
    filter {[key: string]: string}
    Additional request filtering options.
    id str
    The ID of this resource.
    services Sequence[GetIpServicesService]
    ___id_ float
    ___path_ str
    filter Mapping[str, str]
    Additional request filtering options.
    id String
    The ID of this resource.
    services List<Property Map>
    ___id_ Number
    ___path_ String
    filter Map<String>
    Additional request filtering options.

    Supporting Types

    GetIpServicesService

    Address string
    Certificate string
    Disabled bool
    Id string
    Invalid string
    Name string
    Port double
    TlsVersion string
    Vrf string
    Address string
    Certificate string
    Disabled bool
    Id string
    Invalid string
    Name string
    Port float64
    TlsVersion string
    Vrf string
    address String
    certificate String
    disabled Boolean
    id String
    invalid String
    name String
    port Double
    tlsVersion String
    vrf String
    address string
    certificate string
    disabled boolean
    id string
    invalid string
    name string
    port number
    tlsVersion string
    vrf string
    address str
    certificate str
    disabled bool
    id str
    invalid str
    name str
    port float
    tls_version str
    vrf str
    address String
    certificate String
    disabled Boolean
    id String
    invalid String
    name String
    port Number
    tlsVersion String
    vrf String

    Package Details

    Repository
    routeros terraform-routeros/terraform-provider-routeros
    License
    Notes
    This Pulumi package is based on the routeros Terraform Provider.
    routeros logo
    routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros