1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ObjectStorage
  5. getObjectHead
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

oci.ObjectStorage.getObjectHead

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

This data source provides details about metadata of a specific Object resource in Oracle Cloud Infrastructure Object Storage service.

Gets the metadata of an object.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testObjectHead = oci.ObjectStorage.getObjectHead({
    bucket: objectBucket,
    namespace: objectNamespace,
    object: objectObject,
});
Copy
import pulumi
import pulumi_oci as oci

test_object_head = oci.ObjectStorage.get_object_head(bucket=object_bucket,
    namespace=object_namespace,
    object=object_object)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/objectstorage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := objectstorage.GetObjectHead(ctx, &objectstorage.GetObjectHeadArgs{
			Bucket:    objectBucket,
			Namespace: objectNamespace,
			Object:    objectObject,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testObjectHead = Oci.ObjectStorage.GetObjectHead.Invoke(new()
    {
        Bucket = objectBucket,
        Namespace = objectNamespace,
        Object = objectObject,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.ObjectStorage.ObjectStorageFunctions;
import com.pulumi.oci.ObjectStorage.inputs.GetObjectHeadArgs;
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 testObjectHead = ObjectStorageFunctions.getObjectHead(GetObjectHeadArgs.builder()
            .bucket(objectBucket)
            .namespace(objectNamespace)
            .object(objectObject)
            .build());

    }
}
Copy
variables:
  testObjectHead:
    fn::invoke:
      function: oci:ObjectStorage:getObjectHead
      arguments:
        bucket: ${objectBucket}
        namespace: ${objectNamespace}
        object: ${objectObject}
Copy

Using getObjectHead

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 getObjectHead(args: GetObjectHeadArgs, opts?: InvokeOptions): Promise<GetObjectHeadResult>
function getObjectHeadOutput(args: GetObjectHeadOutputArgs, opts?: InvokeOptions): Output<GetObjectHeadResult>
Copy
def get_object_head(bucket: Optional[str] = None,
                    namespace: Optional[str] = None,
                    object: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetObjectHeadResult
def get_object_head_output(bucket: Optional[pulumi.Input[str]] = None,
                    namespace: Optional[pulumi.Input[str]] = None,
                    object: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetObjectHeadResult]
Copy
func GetObjectHead(ctx *Context, args *GetObjectHeadArgs, opts ...InvokeOption) (*GetObjectHeadResult, error)
func GetObjectHeadOutput(ctx *Context, args *GetObjectHeadOutputArgs, opts ...InvokeOption) GetObjectHeadResultOutput
Copy

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

public static class GetObjectHead 
{
    public static Task<GetObjectHeadResult> InvokeAsync(GetObjectHeadArgs args, InvokeOptions? opts = null)
    public static Output<GetObjectHeadResult> Invoke(GetObjectHeadInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetObjectHeadResult> getObjectHead(GetObjectHeadArgs args, InvokeOptions options)
public static Output<GetObjectHeadResult> getObjectHead(GetObjectHeadArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:ObjectStorage/getObjectHead:getObjectHead
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Bucket This property is required. string
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
Namespace This property is required. string
The top-level namespace used for the request.
Object This property is required. string
The name of the object. Avoid entering confidential information. Example: test/object1.log
Bucket This property is required. string
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
Namespace This property is required. string
The top-level namespace used for the request.
Object This property is required. string
The name of the object. Avoid entering confidential information. Example: test/object1.log
bucket This property is required. String
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
namespace This property is required. String
The top-level namespace used for the request.
object This property is required. String
The name of the object. Avoid entering confidential information. Example: test/object1.log
bucket This property is required. string
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
namespace This property is required. string
The top-level namespace used for the request.
object This property is required. string
The name of the object. Avoid entering confidential information. Example: test/object1.log
bucket This property is required. str
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
namespace This property is required. str
The top-level namespace used for the request.
object This property is required. str
The name of the object. Avoid entering confidential information. Example: test/object1.log
bucket This property is required. String
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
namespace This property is required. String
The top-level namespace used for the request.
object This property is required. String
The name of the object. Avoid entering confidential information. Example: test/object1.log

getObjectHead Result

The following output properties are available:

ArchivalState string
Bucket string
ContentLength int
The content-length of the object
ContentType string
The content-type of the object
Etag string
The etag of the object
Id string
The provider-assigned unique ID for this managed resource.
Metadata Dictionary<string, string>
The metadata of the object
Namespace string
Object string
StorageTier string
The storage tier that the object is stored in.

  • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
ArchivalState string
Bucket string
ContentLength int
The content-length of the object
ContentType string
The content-type of the object
Etag string
The etag of the object
Id string
The provider-assigned unique ID for this managed resource.
Metadata map[string]string
The metadata of the object
Namespace string
Object string
StorageTier string
The storage tier that the object is stored in.

  • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
archivalState String
bucket String
contentLength Integer
The content-length of the object
contentType String
The content-type of the object
etag String
The etag of the object
id String
The provider-assigned unique ID for this managed resource.
metadata Map<String,String>
The metadata of the object
namespace String
object String
storageTier String
The storage tier that the object is stored in.

  • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
archivalState string
bucket string
contentLength number
The content-length of the object
contentType string
The content-type of the object
etag string
The etag of the object
id string
The provider-assigned unique ID for this managed resource.
metadata {[key: string]: string}
The metadata of the object
namespace string
object string
storageTier string
The storage tier that the object is stored in.

  • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
archival_state str
bucket str
content_length int
The content-length of the object
content_type str
The content-type of the object
etag str
The etag of the object
id str
The provider-assigned unique ID for this managed resource.
metadata Mapping[str, str]
The metadata of the object
namespace str
object str
storage_tier str
The storage tier that the object is stored in.

  • archival-state - Archival state of an object. This field is set only for objects in Archive tier.
archivalState String
bucket String
contentLength Number
The content-length of the object
contentType String
The content-type of the object
etag String
The etag of the object
id String
The provider-assigned unique ID for this managed resource.
metadata Map<String>
The metadata of the object
namespace String
object String
storageTier String
The storage tier that the object is stored in.

  • archival-state - Archival state of an object. This field is set only for objects in Archive tier.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi