tailf_netconf_transactions

package
v0.0.0-...-50def94 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

This module introduces four new rpc methods that are used to control a two-phase commit transaction on the NETCONF server. The normal <edit-config> operation is used to write data in the transaction, but the modifications are not applied until an explicit <commit-transaction> is sent.

A typical sequence of operations looks like this:

C                           S
|                           |
|  capability exchange      |
|-------------------------->|
|<------------------------->|
|                           |
|   <start-transaction>     |
|-------------------------->|
|<--------------------------|
|         <ok/>             |
|                           |
|     <edit-config>         |
|-------------------------->|
|<--------------------------|
|         <ok/>             |
|                           |
|  <prepare-transaction>    |
|-------------------------->|
|<--------------------------|
|         <ok/>             |
|                           |
|   <commit-transaction>    |
|-------------------------->|
|<--------------------------|
|         <ok/>             |
|                           |

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbortTransaction

type AbortTransaction struct {
	EntityData types.CommonEntityData
	YFilter    yfilter.YFilter
}

AbortTransaction Aborts the ongoing transaction, and all pending changes are discarded. <abort-transaction> can be given at any time during an ongoing transaction.

If there is no ongoing transaction in this session, an error MUST be returned with <error-app-tag> set to 'bad-state'.

func (*AbortTransaction) GetEntityData

func (abortTransaction *AbortTransaction) GetEntityData() *types.CommonEntityData

type CommitTransaction

type CommitTransaction struct {
	EntityData types.CommonEntityData
	YFilter    yfilter.YFilter
}

CommitTransaction Applies the changes made in the transaction to the configuration datatore. The transaction is closed after a <commit-transaction>.

If there is no ongoing transaction in this session, or if the ongoing transaction already has not been prepared, an error MUST be returned with <error-app-tag> set to 'bad-state'.

func (*CommitTransaction) GetEntityData

func (commitTransaction *CommitTransaction) GetEntityData() *types.CommonEntityData

type PrepareTransaction

type PrepareTransaction struct {
	EntityData types.CommonEntityData
	YFilter    yfilter.YFilter
}

PrepareTransaction Prepares the transaction state for commit. The server may reject the prepare request for any reason, for example due to lack of resources or if the combined changes would result in an invalid configuration datastore.

After a successful <prepare-transaction>, the next transaction related rpc operation must be <commit-transaction> or <abort-transaction>. Note that an <edit-config> cannot be sent before the transaction is either committed or aborted.

Care must be taken by the server to make sure that if <prepare-transaction> succeeds then the <commit-transaction> SHOULD not fail, since this might result in an inconsistent distributed state. Thus, <prepare-transaction> should allocate any resources needed to make sure the <commit-transaction> will succeed.

If there is no ongoing transaction in this session, or if the ongoing transaction already has been prepared, an error MUST be returned with <error-app-tag> set to 'bad-state'.

func (*PrepareTransaction) GetEntityData

func (prepareTransaction *PrepareTransaction) GetEntityData() *types.CommonEntityData

type StartTransaction

type StartTransaction struct {
	EntityData types.CommonEntityData
	YFilter    yfilter.YFilter

	Input StartTransaction_Input
}

StartTransaction Starts a transaction towards a configuration datastore. There can be a single ongoing transaction per session at any time.

When a transaction has been started, the client can send any NETCONF operation, but any <edit-config> or <copy-config> operation sent from the client MUST specify the same <target> as the <start-transaction>, and any <get-config> MUST specify the same <source> as <start-transaction>.

If the server receives an <edit-config> or <copy-config> with another <target>, or a <get-config> with another <source>, an error MUST be returned with an <error-tag> set to 'invalid-value'.

The modifications sent in the <edit-config> operations are not immediately applied to the configuration datastore. Instead they are kept in the transaction state of the server. The transaction state is only applied when a <commit-transaction> is received.

The client sends a <prepare-transaction> when all modifications have been sent.

If there is an ongoing transaction for this session already, an error MUST be returned with <error-app-tag> set to 'bad-state'.

func (*StartTransaction) GetEntityData

func (startTransaction *StartTransaction) GetEntityData() *types.CommonEntityData

type StartTransaction_Input

type StartTransaction_Input struct {
	EntityData types.CommonEntityData
	YFilter    yfilter.YFilter

	// If the parameter is present in <start-transaction>, it MUST also be present
	// in any <edit-config>, <copy-config>, <get>, or <get-config> operations
	// within the transaction.  If it is not present in <start-transaction>, it
	// MUST NOT be present in any <edit-config> operation within the transaction.
	// The type is interface{}.
	WithInactive interface{}

	// Name of the configuration datastore towards which the transaction is
	// started.
	Target StartTransaction_Input_Target
}

StartTransaction_Input

func (*StartTransaction_Input) GetEntityData

func (input *StartTransaction_Input) GetEntityData() *types.CommonEntityData

type StartTransaction_Input_Target

type StartTransaction_Input_Target struct {
	EntityData types.CommonEntityData
	YFilter    yfilter.YFilter

	// The type is interface{}.
	Startup interface{}

	// The type is interface{}.
	Running interface{}

	// The type is interface{}.
	Candidate interface{}
}

StartTransaction_Input_Target Name of the configuration datastore towards which the transaction is started.

func (*StartTransaction_Input_Target) GetEntityData

func (target *StartTransaction_Input_Target) GetEntityData() *types.CommonEntityData

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL