1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. VulnerabilityScanning
  5. getHostScanTargets
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi

oci.VulnerabilityScanning.getHostScanTargets

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi

    This data source provides the list of Host Scan Targets in Oracle Cloud Infrastructure Vulnerability Scanning service.

    Retrieves a list of HostScanTargetSummary objects in a compartment. A host scan target is a collection of compute instances that you want routinely scanned for security vulnerabilities.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testHostScanTargets = oci.VulnerabilityScanning.getHostScanTargets({
        compartmentId: compartmentId,
        displayName: hostScanTargetDisplayName,
        state: hostScanTargetState,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_host_scan_targets = oci.VulnerabilityScanning.get_host_scan_targets(compartment_id=compartment_id,
        display_name=host_scan_target_display_name,
        state=host_scan_target_state)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/VulnerabilityScanning"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := VulnerabilityScanning.GetHostScanTargets(ctx, &vulnerabilityscanning.GetHostScanTargetsArgs{
    			CompartmentId: compartmentId,
    			DisplayName:   pulumi.StringRef(hostScanTargetDisplayName),
    			State:         pulumi.StringRef(hostScanTargetState),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testHostScanTargets = Oci.VulnerabilityScanning.GetHostScanTargets.Invoke(new()
        {
            CompartmentId = compartmentId,
            DisplayName = hostScanTargetDisplayName,
            State = hostScanTargetState,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.VulnerabilityScanning.VulnerabilityScanningFunctions;
    import com.pulumi.oci.VulnerabilityScanning.inputs.GetHostScanTargetsArgs;
    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 testHostScanTargets = VulnerabilityScanningFunctions.getHostScanTargets(GetHostScanTargetsArgs.builder()
                .compartmentId(compartmentId)
                .displayName(hostScanTargetDisplayName)
                .state(hostScanTargetState)
                .build());
    
        }
    }
    
    variables:
      testHostScanTargets:
        fn::invoke:
          Function: oci:VulnerabilityScanning:getHostScanTargets
          Arguments:
            compartmentId: ${compartmentId}
            displayName: ${hostScanTargetDisplayName}
            state: ${hostScanTargetState}
    

    Using getHostScanTargets

    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 getHostScanTargets(args: GetHostScanTargetsArgs, opts?: InvokeOptions): Promise<GetHostScanTargetsResult>
    function getHostScanTargetsOutput(args: GetHostScanTargetsOutputArgs, opts?: InvokeOptions): Output<GetHostScanTargetsResult>
    def get_host_scan_targets(compartment_id: Optional[str] = None,
                              display_name: Optional[str] = None,
                              filters: Optional[Sequence[_vulnerabilityscanning.GetHostScanTargetsFilter]] = None,
                              state: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetHostScanTargetsResult
    def get_host_scan_targets_output(compartment_id: Optional[pulumi.Input[str]] = None,
                              display_name: Optional[pulumi.Input[str]] = None,
                              filters: Optional[pulumi.Input[Sequence[pulumi.Input[_vulnerabilityscanning.GetHostScanTargetsFilterArgs]]]] = None,
                              state: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetHostScanTargetsResult]
    func GetHostScanTargets(ctx *Context, args *GetHostScanTargetsArgs, opts ...InvokeOption) (*GetHostScanTargetsResult, error)
    func GetHostScanTargetsOutput(ctx *Context, args *GetHostScanTargetsOutputArgs, opts ...InvokeOption) GetHostScanTargetsResultOutput

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

    public static class GetHostScanTargets 
    {
        public static Task<GetHostScanTargetsResult> InvokeAsync(GetHostScanTargetsArgs args, InvokeOptions? opts = null)
        public static Output<GetHostScanTargetsResult> Invoke(GetHostScanTargetsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetHostScanTargetsResult> getHostScanTargets(GetHostScanTargetsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:VulnerabilityScanning/getHostScanTargets:getHostScanTargets
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The ID of the compartment in which to list resources.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    Filters List<GetHostScanTargetsFilter>
    State string
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    CompartmentId string
    The ID of the compartment in which to list resources.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    Filters []GetHostScanTargetsFilter
    State string
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    compartmentId String
    The ID of the compartment in which to list resources.
    displayName String
    A filter to return only resources that match the entire display name given.
    filters List<GetHostScanTargetsFilter>
    state String
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    compartmentId string
    The ID of the compartment in which to list resources.
    displayName string
    A filter to return only resources that match the entire display name given.
    filters GetHostScanTargetsFilter[]
    state string
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    compartment_id str
    The ID of the compartment in which to list resources.
    display_name str
    A filter to return only resources that match the entire display name given.
    filters Sequence[vulnerabilityscanning.GetHostScanTargetsFilter]
    state str
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    compartmentId String
    The ID of the compartment in which to list resources.
    displayName String
    A filter to return only resources that match the entire display name given.
    filters List<Property Map>
    state String
    A filter to return only resources whose lifecycleState matches the given lifecycleState.

    getHostScanTargets Result

    The following output properties are available:

    CompartmentId string
    Compartment ID of the object (this).
    HostScanTargetSummaryCollections List<GetHostScanTargetsHostScanTargetSummaryCollection>
    The list of host_scan_target_summary_collection.
    Id string
    The provider-assigned unique ID for this managed resource.
    DisplayName string
    Target identifier, which can be renamed.
    Filters List<GetHostScanTargetsFilter>
    State string
    The current state of the config.
    CompartmentId string
    Compartment ID of the object (this).
    HostScanTargetSummaryCollections []GetHostScanTargetsHostScanTargetSummaryCollection
    The list of host_scan_target_summary_collection.
    Id string
    The provider-assigned unique ID for this managed resource.
    DisplayName string
    Target identifier, which can be renamed.
    Filters []GetHostScanTargetsFilter
    State string
    The current state of the config.
    compartmentId String
    Compartment ID of the object (this).
    hostScanTargetSummaryCollections List<GetHostScanTargetsHostScanTargetSummaryCollection>
    The list of host_scan_target_summary_collection.
    id String
    The provider-assigned unique ID for this managed resource.
    displayName String
    Target identifier, which can be renamed.
    filters List<GetHostScanTargetsFilter>
    state String
    The current state of the config.
    compartmentId string
    Compartment ID of the object (this).
    hostScanTargetSummaryCollections GetHostScanTargetsHostScanTargetSummaryCollection[]
    The list of host_scan_target_summary_collection.
    id string
    The provider-assigned unique ID for this managed resource.
    displayName string
    Target identifier, which can be renamed.
    filters GetHostScanTargetsFilter[]
    state string
    The current state of the config.
    compartment_id str
    Compartment ID of the object (this).
    host_scan_target_summary_collections Sequence[vulnerabilityscanning.GetHostScanTargetsHostScanTargetSummaryCollection]
    The list of host_scan_target_summary_collection.
    id str
    The provider-assigned unique ID for this managed resource.
    display_name str
    Target identifier, which can be renamed.
    filters Sequence[vulnerabilityscanning.GetHostScanTargetsFilter]
    state str
    The current state of the config.
    compartmentId String
    Compartment ID of the object (this).
    hostScanTargetSummaryCollections List<Property Map>
    The list of host_scan_target_summary_collection.
    id String
    The provider-assigned unique ID for this managed resource.
    displayName String
    Target identifier, which can be renamed.
    filters List<Property Map>
    state String
    The current state of the config.

    Supporting Types

    GetHostScanTargetsFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetHostScanTargetsHostScanTargetSummaryCollection

    GetHostScanTargetsHostScanTargetSummaryCollectionItem

    CompartmentId string
    The ID of the compartment in which to list resources.
    DefinedTags Dictionary<string, object>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    Description string
    Target description.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    FreeformTags Dictionary<string, object>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    HostScanRecipeId string
    ID of the host scan recipe this target applies.
    Id string
    Unique identifier of the config that is immutable on creation
    InstanceIds List<string>
    List of compute instance IDs to target (optional). If empty, targets the entire targetCompartmentId.
    State string
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    SystemTags Dictionary<string, object>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    TargetCompartmentId string
    Compartment ID to target. If a list of hosts is provided, all hosts must be in this compartment.
    TimeCreated string
    Date and time the target was created, format as described in RFC 3339
    TimeUpdated string
    Date and time the target was last updated, format as described in RFC 3339
    CompartmentId string
    The ID of the compartment in which to list resources.
    DefinedTags map[string]interface{}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    Description string
    Target description.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    FreeformTags map[string]interface{}
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    HostScanRecipeId string
    ID of the host scan recipe this target applies.
    Id string
    Unique identifier of the config that is immutable on creation
    InstanceIds []string
    List of compute instance IDs to target (optional). If empty, targets the entire targetCompartmentId.
    State string
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    SystemTags map[string]interface{}
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    TargetCompartmentId string
    Compartment ID to target. If a list of hosts is provided, all hosts must be in this compartment.
    TimeCreated string
    Date and time the target was created, format as described in RFC 3339
    TimeUpdated string
    Date and time the target was last updated, format as described in RFC 3339
    compartmentId String
    The ID of the compartment in which to list resources.
    definedTags Map<String,Object>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description String
    Target description.
    displayName String
    A filter to return only resources that match the entire display name given.
    freeformTags Map<String,Object>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hostScanRecipeId String
    ID of the host scan recipe this target applies.
    id String
    Unique identifier of the config that is immutable on creation
    instanceIds List<String>
    List of compute instance IDs to target (optional). If empty, targets the entire targetCompartmentId.
    state String
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    systemTags Map<String,Object>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    targetCompartmentId String
    Compartment ID to target. If a list of hosts is provided, all hosts must be in this compartment.
    timeCreated String
    Date and time the target was created, format as described in RFC 3339
    timeUpdated String
    Date and time the target was last updated, format as described in RFC 3339
    compartmentId string
    The ID of the compartment in which to list resources.
    definedTags {[key: string]: any}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description string
    Target description.
    displayName string
    A filter to return only resources that match the entire display name given.
    freeformTags {[key: string]: any}
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hostScanRecipeId string
    ID of the host scan recipe this target applies.
    id string
    Unique identifier of the config that is immutable on creation
    instanceIds string[]
    List of compute instance IDs to target (optional). If empty, targets the entire targetCompartmentId.
    state string
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    systemTags {[key: string]: any}
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    targetCompartmentId string
    Compartment ID to target. If a list of hosts is provided, all hosts must be in this compartment.
    timeCreated string
    Date and time the target was created, format as described in RFC 3339
    timeUpdated string
    Date and time the target was last updated, format as described in RFC 3339
    compartment_id str
    The ID of the compartment in which to list resources.
    defined_tags Mapping[str, Any]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description str
    Target description.
    display_name str
    A filter to return only resources that match the entire display name given.
    freeform_tags Mapping[str, Any]
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    host_scan_recipe_id str
    ID of the host scan recipe this target applies.
    id str
    Unique identifier of the config that is immutable on creation
    instance_ids Sequence[str]
    List of compute instance IDs to target (optional). If empty, targets the entire targetCompartmentId.
    state str
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    system_tags Mapping[str, Any]
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    target_compartment_id str
    Compartment ID to target. If a list of hosts is provided, all hosts must be in this compartment.
    time_created str
    Date and time the target was created, format as described in RFC 3339
    time_updated str
    Date and time the target was last updated, format as described in RFC 3339
    compartmentId String
    The ID of the compartment in which to list resources.
    definedTags Map<Any>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description String
    Target description.
    displayName String
    A filter to return only resources that match the entire display name given.
    freeformTags Map<Any>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    hostScanRecipeId String
    ID of the host scan recipe this target applies.
    id String
    Unique identifier of the config that is immutable on creation
    instanceIds List<String>
    List of compute instance IDs to target (optional). If empty, targets the entire targetCompartmentId.
    state String
    A filter to return only resources whose lifecycleState matches the given lifecycleState.
    systemTags Map<Any>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    targetCompartmentId String
    Compartment ID to target. If a list of hosts is provided, all hosts must be in this compartment.
    timeCreated String
    Date and time the target was created, format as described in RFC 3339
    timeUpdated String
    Date and time the target was last updated, format as described in RFC 3339

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi