// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Routeros.Ip
{
    /// <summary>
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using Routeros = Pulumi.Routeros;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var aRoute = new Routeros.Ip.Route("aRoute", new()
    ///     {
    ///         DstAddress = "0.0.0.0/0",
    ///         Gateway = "10.0.0.1",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// #The ID can be found via API or the terminal #The command for the terminal is -&gt; :put [/ip/route get [print show-ids]]
    /// 
    /// ```sh
    ///  $ pulumi import routeros:Ip/route:Route a_route "*0"
    /// ```
    /// </summary>
    [RouterosResourceType("routeros:Ip/route:Route")]
    public partial class Route : global::Pulumi.CustomResource
    {
        /// <summary>
        /// &lt;em&gt;Resource ID type (.id / name). This is an internal service field, setting a value is not required.&lt;/em&gt;
        /// </summary>
        [Output("___id_")]
        public Output<int?> ___id_ { get; private set; } = null!;

        /// <summary>
        /// &lt;em&gt;Resource path for CRUD operations. This is an internal service field, setting a value is not required.&lt;/em&gt;
        /// </summary>
        [Output("___path_")]
        public Output<string?> ___path_ { get; private set; } = null!;

        /// <summary>
        /// A flag indicates whether the route is elected as Active and eligible to be added to the FIB.
        /// </summary>
        [Output("active")]
        public Output<bool> Active { get; private set; } = null!;

        /// <summary>
        /// It's a blackhole route.
        /// </summary>
        [Output("blackhole")]
        public Output<bool?> Blackhole { get; private set; } = null!;

        /// <summary>
        /// Currently used check-gateway option.
        /// </summary>
        [Output("checkGateway")]
        public Output<string?> CheckGateway { get; private set; } = null!;

        [Output("comment")]
        public Output<string?> Comment { get; private set; } = null!;

        /// <summary>
        /// A flag indicates whether the route was added by the DHCP service.
        /// </summary>
        [Output("dhcp")]
        public Output<bool> Dhcp { get; private set; } = null!;

        [Output("disabled")]
        public Output<bool?> Disabled { get; private set; } = null!;

        /// <summary>
        /// Value used in route selection. Routes with smaller distance value are given preference.
        /// </summary>
        [Output("distance")]
        public Output<int?> Distance { get; private set; } = null!;

        /// <summary>
        /// IP prefix of route, specifies destination addresses that this route can be used for.
        /// </summary>
        [Output("dstAddress")]
        public Output<string?> DstAddress { get; private set; } = null!;

        /// <summary>
        /// Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
        /// </summary>
        [Output("dynamic")]
        public Output<bool> Dynamic { get; private set; } = null!;

        /// <summary>
        /// A flag indicates whether the route is added as an Equal-Cost Multi-Path route in the FIB.
        /// </summary>
        [Output("ecmp")]
        public Output<bool> Ecmp { get; private set; } = null!;

        /// <summary>
        /// Array of IP addresses or interface names. Specifies which host or interface packets should be sent to (IP | interface | IP%interface | IP@table[, IP | string, [..]]).
        /// </summary>
        [Output("gateway")]
        public Output<string> Gateway { get; private set; } = null!;

        /// <summary>
        /// Indicates whether the route is eligible to be hardware offloaded on supported hardware.
        /// </summary>
        [Output("hwOffloaded")]
        public Output<bool> HwOffloaded { get; private set; } = null!;

        /// <summary>
        /// Shows actual (resolved) gateway and interface that will be used for packet forwarding.
        /// </summary>
        [Output("immediateGw")]
        public Output<string> ImmediateGw { get; private set; } = null!;

        [Output("inactive")]
        public Output<bool> Inactive { get; private set; } = null!;

        /// <summary>
        /// Which of the local IP addresses to use for locally originated packets that are sent via this route. Value of this property has no effect on forwarded packets. If value of this property is set to IP address that is not local address of this router then the route will be inactive (in ROS v6, ROS v7 allows IP spoofing).
        /// </summary>
        [Output("prefSrc")]
        public Output<string?> PrefSrc { get; private set; } = null!;

        /// <summary>
        /// Routing table this route belongs to.
        /// </summary>
        [Output("routingTable")]
        public Output<string?> RoutingTable { get; private set; } = null!;

        /// <summary>
        /// Used in nexthop resolution. Route can resolve nexthop only through routes that have scope less than or equal to the target-scope of this route.
        /// </summary>
        [Output("scope")]
        public Output<int?> Scope { get; private set; } = null!;

        [Output("static")]
        public Output<bool> Static { get; private set; } = null!;

        [Output("suppressHwOffload")]
        public Output<bool> SuppressHwOffload { get; private set; } = null!;

        /// <summary>
        /// Used in nexthop resolution. This is the maximum value of scope for a route through which a nexthop of this route can be resolved.
        /// </summary>
        [Output("targetScope")]
        public Output<int?> TargetScope { get; private set; } = null!;

        /// <summary>
        /// VRF interface name.
        /// </summary>
        [Output("vrfInterface")]
        public Output<string> VrfInterface { get; private set; } = null!;


        /// <summary>
        /// Create a Route resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public Route(string name, RouteArgs args, CustomResourceOptions? options = null)
            : base("routeros:Ip/route:Route", name, args ?? new RouteArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Route(string name, Input<string> id, RouteState? state = null, CustomResourceOptions? options = null)
            : base("routeros:Ip/route:Route", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing Route resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static Route Get(string name, Input<string> id, RouteState? state = null, CustomResourceOptions? options = null)
        {
            return new Route(name, id, state, options);
        }
    }

    public sealed class RouteArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// &lt;em&gt;Resource ID type (.id / name). This is an internal service field, setting a value is not required.&lt;/em&gt;
        /// </summary>
        [Input("___id_")]
        public Input<int>? ___id_ { get; set; }

        /// <summary>
        /// &lt;em&gt;Resource path for CRUD operations. This is an internal service field, setting a value is not required.&lt;/em&gt;
        /// </summary>
        [Input("___path_")]
        public Input<string>? ___path_ { get; set; }

        /// <summary>
        /// It's a blackhole route.
        /// </summary>
        [Input("blackhole")]
        public Input<bool>? Blackhole { get; set; }

        /// <summary>
        /// Currently used check-gateway option.
        /// </summary>
        [Input("checkGateway")]
        public Input<string>? CheckGateway { get; set; }

        [Input("comment")]
        public Input<string>? Comment { get; set; }

        [Input("disabled")]
        public Input<bool>? Disabled { get; set; }

        /// <summary>
        /// Value used in route selection. Routes with smaller distance value are given preference.
        /// </summary>
        [Input("distance")]
        public Input<int>? Distance { get; set; }

        /// <summary>
        /// IP prefix of route, specifies destination addresses that this route can be used for.
        /// </summary>
        [Input("dstAddress")]
        public Input<string>? DstAddress { get; set; }

        /// <summary>
        /// Array of IP addresses or interface names. Specifies which host or interface packets should be sent to (IP | interface | IP%interface | IP@table[, IP | string, [..]]).
        /// </summary>
        [Input("gateway", required: true)]
        public Input<string> Gateway { get; set; } = null!;

        /// <summary>
        /// Which of the local IP addresses to use for locally originated packets that are sent via this route. Value of this property has no effect on forwarded packets. If value of this property is set to IP address that is not local address of this router then the route will be inactive (in ROS v6, ROS v7 allows IP spoofing).
        /// </summary>
        [Input("prefSrc")]
        public Input<string>? PrefSrc { get; set; }

        /// <summary>
        /// Routing table this route belongs to.
        /// </summary>
        [Input("routingTable")]
        public Input<string>? RoutingTable { get; set; }

        /// <summary>
        /// Used in nexthop resolution. Route can resolve nexthop only through routes that have scope less than or equal to the target-scope of this route.
        /// </summary>
        [Input("scope")]
        public Input<int>? Scope { get; set; }

        /// <summary>
        /// Used in nexthop resolution. This is the maximum value of scope for a route through which a nexthop of this route can be resolved.
        /// </summary>
        [Input("targetScope")]
        public Input<int>? TargetScope { get; set; }

        /// <summary>
        /// VRF interface name.
        /// </summary>
        [Input("vrfInterface")]
        public Input<string>? VrfInterface { get; set; }

        public RouteArgs()
        {
        }
        public static new RouteArgs Empty => new RouteArgs();
    }

    public sealed class RouteState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// &lt;em&gt;Resource ID type (.id / name). This is an internal service field, setting a value is not required.&lt;/em&gt;
        /// </summary>
        [Input("___id_")]
        public Input<int>? ___id_ { get; set; }

        /// <summary>
        /// &lt;em&gt;Resource path for CRUD operations. This is an internal service field, setting a value is not required.&lt;/em&gt;
        /// </summary>
        [Input("___path_")]
        public Input<string>? ___path_ { get; set; }

        /// <summary>
        /// A flag indicates whether the route is elected as Active and eligible to be added to the FIB.
        /// </summary>
        [Input("active")]
        public Input<bool>? Active { get; set; }

        /// <summary>
        /// It's a blackhole route.
        /// </summary>
        [Input("blackhole")]
        public Input<bool>? Blackhole { get; set; }

        /// <summary>
        /// Currently used check-gateway option.
        /// </summary>
        [Input("checkGateway")]
        public Input<string>? CheckGateway { get; set; }

        [Input("comment")]
        public Input<string>? Comment { get; set; }

        /// <summary>
        /// A flag indicates whether the route was added by the DHCP service.
        /// </summary>
        [Input("dhcp")]
        public Input<bool>? Dhcp { get; set; }

        [Input("disabled")]
        public Input<bool>? Disabled { get; set; }

        /// <summary>
        /// Value used in route selection. Routes with smaller distance value are given preference.
        /// </summary>
        [Input("distance")]
        public Input<int>? Distance { get; set; }

        /// <summary>
        /// IP prefix of route, specifies destination addresses that this route can be used for.
        /// </summary>
        [Input("dstAddress")]
        public Input<string>? DstAddress { get; set; }

        /// <summary>
        /// Configuration item created by software, not by management interface. It is not exported, and cannot be directly modified.
        /// </summary>
        [Input("dynamic")]
        public Input<bool>? Dynamic { get; set; }

        /// <summary>
        /// A flag indicates whether the route is added as an Equal-Cost Multi-Path route in the FIB.
        /// </summary>
        [Input("ecmp")]
        public Input<bool>? Ecmp { get; set; }

        /// <summary>
        /// Array of IP addresses or interface names. Specifies which host or interface packets should be sent to (IP | interface | IP%interface | IP@table[, IP | string, [..]]).
        /// </summary>
        [Input("gateway")]
        public Input<string>? Gateway { get; set; }

        /// <summary>
        /// Indicates whether the route is eligible to be hardware offloaded on supported hardware.
        /// </summary>
        [Input("hwOffloaded")]
        public Input<bool>? HwOffloaded { get; set; }

        /// <summary>
        /// Shows actual (resolved) gateway and interface that will be used for packet forwarding.
        /// </summary>
        [Input("immediateGw")]
        public Input<string>? ImmediateGw { get; set; }

        [Input("inactive")]
        public Input<bool>? Inactive { get; set; }

        /// <summary>
        /// Which of the local IP addresses to use for locally originated packets that are sent via this route. Value of this property has no effect on forwarded packets. If value of this property is set to IP address that is not local address of this router then the route will be inactive (in ROS v6, ROS v7 allows IP spoofing).
        /// </summary>
        [Input("prefSrc")]
        public Input<string>? PrefSrc { get; set; }

        /// <summary>
        /// Routing table this route belongs to.
        /// </summary>
        [Input("routingTable")]
        public Input<string>? RoutingTable { get; set; }

        /// <summary>
        /// Used in nexthop resolution. Route can resolve nexthop only through routes that have scope less than or equal to the target-scope of this route.
        /// </summary>
        [Input("scope")]
        public Input<int>? Scope { get; set; }

        [Input("static")]
        public Input<bool>? Static { get; set; }

        [Input("suppressHwOffload")]
        public Input<bool>? SuppressHwOffload { get; set; }

        /// <summary>
        /// Used in nexthop resolution. This is the maximum value of scope for a route through which a nexthop of this route can be resolved.
        /// </summary>
        [Input("targetScope")]
        public Input<int>? TargetScope { get; set; }

        /// <summary>
        /// VRF interface name.
        /// </summary>
        [Input("vrfInterface")]
        public Input<string>? VrfInterface { get; set; }

        public RouteState()
        {
        }
        public static new RouteState Empty => new RouteState();
    }
}
