Skip to content

Commit 7d95126

Browse files
authored
Virtualization SDK Docs - Final VSDK 3.0.0 docs and release changes (#311) (#312)
1 parent 6acfa72 commit 7d95126

File tree

5 files changed

+110
-39
lines changed

5 files changed

+110
-39
lines changed

docs/docs/Building_Your_First_Plugin/Data_Ingestion.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ quite limiting.
2121

2222
For our first plugin, we will be using the more flexible [staging](/References/Glossary.md#staged-linkingsyncing) strategy. With this strategy, the Delphix Engine uses NFS for Unix environments (or iSCSI on Windows environments) to mount storage onto a [staging environment](/References/Glossary.md#staging-environment). Our plugin will then be in full control of how to get data from the source environment onto this storage mount.
2323

24-
With the staging strategy, there are two types of syncs: sync and resync. A `sync` is used to ingestion incremental changes while a `resync` is used to re-ingest all the data for the dSource. For databases, this could mean re-ingesting from a full database backup to reset the dSource. A `sync` and a `resync` execute the same plugin operations and are differentiated by a boolean flag in the [snapshot_parameters](/References/Classes.md#snapshotparametersdefinition) argument passed into [linked.pre_snapshot](/References/Plugin_Operations.md#staged-linked-source-pre-snapshot) and [linked.post_snapshot](/References/Plugin_Operations.md#staged-linked-source-post-snapshot).
24+
With the staging strategy, there are two types of syncs: sync and resync. A `sync` is used to ingest incremental changes while a `resync` is used to re-ingest all the data for the dSource. For databases, this could mean re-ingesting from a full database backup to reset the dSource. A `sync` and a `resync` will execute the same plugin operations. To differentiate a `sync` from a `resync`, simply add a boolean property (i.e. `resync`) in the plugin's [snapshot parameters definition](References/Schemas_and_Autogenerated_Classes.md#snapshotparametersdefinition-schema). Once `sync` or `resync` is selected, the property will be passed into [linked.pre_snapshot](/References/Plugin_Operations.md#staged-linked-source-pre-snapshot) and [linked.post_snapshot](/References/Plugin_Operations.md#staged-linked-source-post-snapshot) as a [snapshot parameter](/References/Glossary.md#snapshot-parameters).
2525

2626
A regular `sync` is the default and is executed as part of policy driven syncs. A `resync` is only executed during initial ingestion or if the Delphix user manually starts one. The customer can manually trigger a `resync` via the UI by selecting the dSource, going to more options and selecting **Resynchronize dSource**. ![Screenshot](images/Resync.png)
2727

@@ -168,7 +168,7 @@ Next, we'll add a new function:
168168

169169
```python
170170
@plugin.linked.pre_snapshot()
171-
def copy_data_from_source(staged_source, repository, source_config, snapshot_parameters):
171+
def copy_data_from_source(staged_source, repository, source_config, optional_snapshot_parameters):
172172
stage_mount_path = staged_source.mount.mount_path
173173
data_location = "{}@{}:{}".format(staged_source.parameters.username,
174174
staged_source.parameters.source_address,
@@ -249,7 +249,7 @@ In fact, the default implementation that was generated by `dvp init` will work j
249249
def linked_post_snapshot(staged_source,
250250
repository,
251251
source_config,
252-
snapshot_parameters):
252+
optional_snapshot_parameters):
253253
return SnapshotDefinition()
254254
```
255255

docs/docs/References/Classes.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -144,29 +144,6 @@ Field | Type | Description
144144
mounts | list[[Mount](#mount)] | The list of mounts to export the data sets to.
145145
ownership_specification | [OwnershipSpecification](#ownershipspecification) | **Optional.** Control the ownership attributes for the data set. It defaults to the environment user of the remote environment if it is not specified.
146146

147-
## SnapshotParametersDefinition
148-
149-
User provided parameters for the snapshot operation. It includes a boolean property named `resync` that can be used to indicate to the plugin whether or not to initiate a full ingestion of the dSource. The parameters are only set during a manual snapshot. When using a sync policy, `resync` defaults to `false`.
150-
151-
```python
152-
from dlpx.virtualization.platform import Plugin
153-
154-
plugin = Plugin()
155-
156-
@plugin.linked.pre_snapshot()
157-
def linked_pre_snapshot(staged_source, repository, source_config, snapshot_parameters):
158-
if snapshot_parameter.resync:
159-
print(snapshot_parameter.resync)
160-
```
161-
162-
> This class will be generated during build and is located with the autogenerated classes. As it is passed into the operation, importing it is not neccessary.
163-
164-
### Fields
165-
166-
Field | Type | Description
167-
----- | ---- | -----------
168-
resync | Boolean | Determines if this snapshot should ingest the dSource from scratch.
169-
170147
## RemoteEnvironment
171148

172149
Represents a remote environment.

docs/docs/References/Plugin_Operations.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Sets up a [dSource](Glossary.md#dsource) to ingest data. Only applies when using
177177

178178
### Signature
179179

180-
`def linked_pre_snapshot(direct_source, repository, source_config)`
180+
`def linked_pre_snapshot(direct_source, repository, source_config, optional_snapshot_parameters)`
181181

182182
### Decorator
183183

@@ -190,6 +190,7 @@ Argument | Type | Description
190190
direct_source | [DirectSource](Classes.md#directsource) | The source associated with this operation.
191191
repository | [RepositoryDefinition](Schemas_and_Autogenerated_Classes.md#repositorydefinition-class) | The repository associated with this source.
192192
source_config | [SourceConfigDefinition](Schemas_and_Autogenerated_Classes.md#sourceconfigdefinition-class) | The source config associated with this source.
193+
optional_snapshot_parameters | [SnapshotParametersDefinition](Classes.md#snapshotparametersdefinition) | The snapshot parameters. The value is `None` when executed during a snapshot policy.
193194

194195
### Returns
195196
None
@@ -220,7 +221,7 @@ Captures metadata from a [dSource](Glossary.md#dsource) once data has been inges
220221

221222
### Signature
222223

223-
`def linked_post_snapshot(direct_source, repository, source_config)`
224+
`def linked_post_snapshot(direct_source, repository, source_config, optional_snapshot_parameters)`
224225

225226
### Decorator
226227

@@ -233,6 +234,7 @@ Argument | Type | Description
233234
direct_source | [DirectSource](Classes.md#directsource) | The source associated with this operation.
234235
repository | [RepositoryDefinition](Schemas_and_Autogenerated_Classes.md#repositorydefinition-class) | The repository associated with this source.
235236
source_config | [SourceConfigDefinition](Schemas_and_Autogenerated_Classes.md#sourceconfigdefinition-class) | The source config associated with this source.
237+
optional_snapshot_parameters | [SnapshotParametersDefinition](Classes.md#snapshotparametersdefinition) | The snapshot parameters. The value is `None` when executed during a snapshot policy.
236238

237239
### Returns
238240
[SnapshotDefinition](Schemas_and_Autogenerated_Classes.md#snapshotdefinition-class)
@@ -246,7 +248,7 @@ from generated.definitions import SnapshotDefinition
246248
plugin = Plugin()
247249

248250
@plugin.linked.post_snapshot()
249-
def linked_post_snapshot(direct_source, repository, source_config):
251+
def linked_post_snapshot(direct_source, repository, source_config, optional_snapshot_parameters):
250252
snapshot = SnapshotDefinition()
251253
snapshot.transaction_id = 1000
252254
return snapshot
@@ -277,7 +279,7 @@ Sets up a [dSource](Glossary.md#dsource) to ingest data. Only applies when using
277279

278280
### Signature
279281

280-
`def linked_pre_snapshot(staged_source, repository, source_config, snapshot_parameters)`
282+
`def linked_pre_snapshot(staged_source, repository, source_config, optional_snapshot_parameters)`
281283

282284
### Decorator
283285

@@ -290,7 +292,7 @@ Argument | Type | Description
290292
staged_source | [StagedSource](Classes.md#stagedsource) | The source associated with this operation.
291293
repository | [RepositoryDefinition](Schemas_and_Autogenerated_Classes.md#repositorydefinition-class) | The repository associated with this source.
292294
source_config | [SourceConfigDefinition](Schemas_and_Autogenerated_Classes.md#sourceconfigdefinition-class) | The source config associated with this source.
293-
snapshot_parameters | [SnapshotParametersDefinition](Classes.md#snapshotparametersdefinition) | The snapshot parameters.
295+
optional_snapshot_parameters | [SnapshotParametersDefinition](Classes.md#snapshotparametersdefinition) | The snapshot parameters. The value is `None` when executed during a snapshot policy.
294296

295297
### Returns
296298
None
@@ -303,7 +305,7 @@ from dlpx.virtualization.platform import Plugin
303305
plugin = Plugin()
304306

305307
@plugin.linked.pre_snapshot()
306-
def linked_pre_snapshot(staged_source, repository, source_config, snapshot_parameters):
308+
def linked_pre_snapshot(staged_source, repository, source_config, optional_snapshot_parameters):
307309
pass
308310
```
309311

@@ -320,7 +322,7 @@ Captures metadata from a [dSource](Glossary.md#dsource) once data has been inges
320322

321323
### Signature
322324

323-
`def linked_post_snapshot(staged_source, repository, source_config, snapshot_parameters)`
325+
`def linked_post_snapshot(staged_source, repository, source_config, optional_snapshot_parameters)`
324326

325327
### Decorator
326328

@@ -333,7 +335,7 @@ Argument | Type | Description
333335
staged_source | [StagedSource](Classes.md#stagedsource) | The source associated with this operation.
334336
repository | [RepositoryDefinition](Schemas_and_Autogenerated_Classes.md#repositorydefinition-class) | The repository associated with this source.
335337
source_config | [SourceConfigDefinition](Schemas_and_Autogenerated_Classes.md#sourceconfigdefinition-class) | The source config associated with this source.
336-
snapshot_parameters | [SnapshotParametersDefinition](Classes.md#snapshotparametersdefinition) | The snapshot parameters.
338+
optional_snapshot_parameters | [SnapshotParametersDefinition](Classes.md#snapshotparametersdefinition) | The snapshot parameters. The value is `None` when executed during a snapshot policy.
337339

338340
### Returns
339341
[SnapshotDefinition](Schemas_and_Autogenerated_Classes.md#snapshotdefinition-class)
@@ -347,9 +349,9 @@ from generated.definitions import SnapshotDefinition
347349
plugin = Plugin()
348350

349351
@plugin.linked.post_snapshot()
350-
def linked_post_snapshot(staged_source, repository, source_config, snapshot_parameters):
352+
def linked_post_snapshot(staged_source, repository, source_config, optional_snapshot_parameters):
351353
snapshot = SnapshotDefinition()
352-
if snapshot_parameters.resync:
354+
if optional_snapshot_parameters is not None and optional_snapshot_parameters.resync:
353355
snapshot.transaction_id = 1000
354356
else:
355357
snapshot.transaction_id = 10

docs/docs/Release_Notes/3.0.0/3.0.0.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,25 @@
33
To install or upgrade the SDK, refer to instructions [here](/Getting_Started.md#installation).
44

55
## New & Improved
6-
* Added a `scratch_path` property on the [RemoteHost](/References/Classes/#remotehost) object for storage and debugging purposes.
6+
* Added the ability to define snapshot parameters in a [Snapshot Parameters Definition](/References/Schemas_and_Autogenerated_Classes.md#snapshotparametersdefinition-schema).
7+
* Provide end-users with configurable options prior to taking a snapshot.
8+
* The options selected are provided as input to pre/post-snapshot functions.
9+
10+
* Added a `scratch_path` property on the [RemoteHost](/References/Classes/#remotehost) object which can be used as:
11+
* A location to store small amounts of persistent data.
12+
* A location to mount VDB data.
713
More details about `scratch_path` can be found [here](/Best_Practices/Scratch_Paths.md)
814

915
## Breaking Changes
1016

1117
* Added a new required schema [Snapshot Parameters Definition](/References/Schemas_and_Autogenerated_Classes.md#snapshotparametersdefinition-schema).
1218

13-
[**For more information and detailed steps to detect and make changes.**](/Release_Notes/3.0.0/3.0.0_Breaking_Changes#new-required-schema)
19+
[**For more information and detailed steps to detect and make changes.**](/Release_Notes/3.0.0/3.0.0_Breaking_Changes#new-required-schema)
20+
21+
* Added a new parameter to the [Direct Linked Source Pre-Snapshot](/References/Plugin_Operations/#direct-linked-source-pre-snapshot) and [Direct Linked Source Post-Snapshot](/References/Plugin_Operations/#direct-linked-source-pre-snapshot) plugin operations.
22+
23+
[**For more information and detailed steps to detect and make changes.**](/Release_Notes/3.0.0/3.0.0_Breaking_Changes#new-parameter-in-direct-prepost-snapshot-functions)
24+
25+
* Renamed a parameter in the [Staged Linked Source Pre-Snapshot](/References/Plugin_Operations/#staged-linked-source-pre-snapshot) and [Staged Linked Source Post-Snapshot](/References/Plugin_Operations/#staged-linked-source-post-snapshot) plugin operations.
26+
27+
[**For more information and detailed steps to detect and make changes.**](/Release_Notes/3.0.0/3.0.0_Breaking_Changes#parameter-renamed-in-staged-prepost-snapshot-functions)

docs/docs/Release_Notes/3.0.0/3.0.0_Breaking_Changes.md

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Breaking Changes - v.3.0.0
22

33
## New required schema
4-
[Snapshot Parameters Definition](/References/Schemas_and_Autogenerated_Classes.md#snapshotparametersdefinition-schema) allows plugin authors to define [Snapshot Parameters] which can be displayed to an end-user whenever a linked source snapshot is taken.
4+
[Snapshot Parameters Definition](/References/Schemas_and_Autogenerated_Classes.md#snapshotparametersdefinition-schema) allows plugin authors to define [snapshot parameters](/References/Glossary.md#snapshot-parameters) which can be displayed to an end-user whenever a linked source snapshot is taken.
55

66
### What is affected
77
All plugins built with v2.0.0 or below will be affected. The [Schema](/References/Schemas) must contain a `snapshotParametersDefinition`.
@@ -34,3 +34,81 @@ Example:
3434
"type": "object"
3535
}
3636
```
37+
38+
## New Parameter in Direct Pre/Post-Snapshot Functions
39+
`optional_snapshot_parameters` has been added as a parameter in [Direct Linked Source Pre-Snapshot](/References/Plugin_Operations/#direct-linked-source-pre-snapshot) and [Direct Linked Source Post-Snapshot](/References/Plugin_Operations/#direct-linked-source-post-snapshot).
40+
41+
### What is affected
42+
All direct plugins built with v2.1.0 or below will be affected.
43+
44+
### How does it fail
45+
[dvp build](/References/CLI.md#build) will fail with the following error message if the `optional_snapshot_parameters` is not added:
46+
47+
```bash
48+
$ dvp build
49+
Error: Named argument mismatch in method linked_post_snapshot. Expected: ['staged_source', 'repository', 'source_config', 'optional_snapshot_parameters'], Found: ['staged_source', 'repository', 'source_config'].
50+
51+
0 Warning(s). 1 Error(s).
52+
53+
BUILD FAILED.
54+
```
55+
56+
### How to fix it
57+
Add `optional_snapshot_parameters` as a parameter in [Direct Linked Source Pre-Snapshot](/References/Plugin_Operations/#direct-linked-source-pre-snapshot) and [Direct Linked Source Post-Snapshot](/References/Plugin_Operations/#direct-linked-source-post-snapshot).
58+
59+
* Previous releases
60+
61+
```python
62+
@plugin.linked.post_snapshot()
63+
def linked_post_snapshot(direct_source, repository, source_config):
64+
return SnapshotDefinition()
65+
```
66+
67+
* 3.0.0
68+
69+
```python
70+
@plugin.linked.post_snapshot()
71+
def linked_post_snapshot(direct_source, repository, source_config, optional_snapshot_parameters):
72+
return SnapshotDefinition()
73+
```
74+
75+
## Parameter Renamed in Staged Pre/Post-Snapshot Functions
76+
The following parameter was renamed in the [Staged Linked Source Pre-Snapshot](/References/Plugin_Operations/#staged-linked-source-pre-snapshot) and [Staged Linked Source Post-Snapshot](/References/Plugin_Operations/#staged-linked-source-post-snapshot) functions:
77+
78+
| Previous | Updated |
79+
| -------- | ------- |
80+
| `snapshot_parameters` | `optional_snapshot_parameters` |
81+
82+
### What is affected
83+
All staged plugins built with v2.1.0 or below will be affected.
84+
85+
### How does it fail
86+
[dvp build](/References/CLI.md#build) will fail with the following error message if the parameter is not renamed from `snapshot_parameters` to `optional_snapshot_parameters`:
87+
88+
```bash
89+
$ dvp build
90+
Error: Named argument mismatch in method linked_post_snapshot. Expected: ['staged_source', 'repository', 'source_config', 'optional_snapshot_parameters'], Found: ['staged_source', 'repository', 'source_config', 'snapshot_parameters'].
91+
92+
0 Warning(s). 1 Error(s).
93+
94+
BUILD FAILED.
95+
```
96+
97+
### How to fix it
98+
Rename `snapshot_parameters` to `optional_snapshot_parameters` in [Staged Linked Source Pre-Snapshot](/References/Plugin_Operations/#staged-linked-source-pre-snapshot) and [Staged Linked Source Post-Snapshot](/References/Plugin_Operations/#staged-linked-source-post-snapshot).
99+
100+
* Previous releases
101+
102+
```python
103+
@plugin.linked.post_snapshot()
104+
def linked_post_snapshot(staged_source, repository, source_config, snapshot_parameters):
105+
return SnapshotDefinition()
106+
```
107+
108+
* 3.0.0
109+
110+
```python
111+
@plugin.linked.post_snapshot()
112+
def linked_post_snapshot(staged_source, repository, source_config, optional_snapshot_parameters):
113+
return SnapshotDefinition()
114+
```

0 commit comments

Comments
 (0)