Skip to content

Getting the container

Retrieves information about a container by its ID.

Arguments:

  1. Execution context
  2. Method arguments, which includes:
    • Container ID
    • Additional headers (optional)

Result:

  • Container metadata, including:
    • Version
    • Owner identifier
    • Attributes
    • Placement policy
    • Unique identifier (GUID)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
func GetContainer(p pool.Pool, cnrID cid.ID) container.Container {
    getPrm := pool.PrmContainerGet{ 
        ContainerID: cnrID,
    }

    ctx := context.Background()

    cnr, err := p.GetContainer(ctx, getPrm)
    checkError(err)

    return cnr
}
1
2
3
4
public static Container getContainer(FrostFSClient frostFSClient, ContainerId containerId, CallContext callContext) {
    var prmContainerGet = new PrmContainerGet(containerId);
    return frostFSClient.getContainer(prmContainerGet, callContext);
}
1
2
3
4
5
6
7
8
public static async Task<FrostFsContainerId> GetContainerAsync(FrostFSClient client, FrostFsContainerId containerId)
{
    PrmContainerGet getContainerParam = new (containerId);

    CallContext ctx = default;

    return await client.GetContainerAsync(getContainerParam, ctx);
}