Skip to content

Deleting Rules

Deletes a rule by its ID and Target.

Note

The rule will be deleted after 1-2 blocks have passed.

Arguments:

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

Result:

  • Success, if there are no errors
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
func RemoveChain(ctx context.Context, p pool.Pool, cnrID cid.ID, chainId ape.ChainID) {
    prmRemoveAPEChain := pool.PrmRemoveAPEChain{
        Target: ape.ChainTarget{
            TargetType: ape.TargetTypeContainer,
            Name:       cnrID.EncodeToString(),
        },
        ChainID: chainId,
    }

    p.RemoveAPEChain(ctx, prmRemoveAPEChain)
}
1
2
3
4
5
6
7
8
9
public static void removeChain(FrostFSClient frostFSClient, 
                           ContainerId containerId, 
                           byte[] chainId, 
                           CallContext callContext) {
    var chainTarget = new ChainTarget(containerId.getValue(), TargetType.CONTAINER);
    var prmApeChainRemove = new PrmApeChainRemove(chainId, chainTarget);

    frostFSClient.removeChain(prmApeChainRemove, callContext);
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
public static async Task RemoveChain(
    IFrostFSClient client,
    FrostFsContainerId containerId,
    byte[] chainId)
{
    var removeChainPrm = new PrmApeChainRemove(
       new FrostFsChainTarget(FrostFsTargetType.Container, containerId.GetValue()),
       chainId
   );

    await client.RemoveChainAsync(removeChainPrm, default);
}