Skip to content

Commit dbfca4a

Browse files
committed
Some more content for the operations article
1 parent 1755b0b commit dbfca4a

File tree

5 files changed

+53
-82
lines changed

5 files changed

+53
-82
lines changed
15.4 KB
Loading
Loading
Loading

articles/storage-actions/storage-tasks/storage-task-conditions.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,10 @@ This article describes the format of a storage task condition and the properties
2222
2323
## Condition format
2424

25-
A storage task contains a set of conditions and operations in a JSON document. The following snippet shows how conditions and operations appear in that document.
25+
A storage task contains a set of conditions and operations in a JSON document. The following image shows how a single condition and operation appear in a the document.
2626

27-
```json
28-
"action": {
29-
"if": {
30-
"condition": "<clause>",
31-
"operations": [
32-
{
33-
"name": "<operation name>",
34-
"onSuccess": "continue",
35-
"onFailure": "break"
36-
}
37-
]
38-
}
39-
}
40-
```
27+
> [!div class="mx-imgBorder"]
28+
> ![Location of conditions and operations in a JSON snippet.](../media/storage-tasks/storage-task-operations/storage-task-operations-location-of-conditions-and-operations.png)
4129
4230
A condition a collection of one or more _clauses_. Each clause contains a _property_, a _value_, and an _operator_. When the storage task runs, it uses the operator to compare a property with a value to determine whether a clause is met by the target object. In a clause, the **operator** always appears first followed by the **property**, and then the **value**. The following image shows how each element is positioned in the expression.
4331

@@ -127,4 +115,5 @@ The following table shows the operators that you can use in a clause to evaluate
127115

128116
## See also
129117

118+
- [Storage task operations](storage-task-operations.md)
130119
- [Define conditions and operations](storage-task-conditions-operations-edit.md)

articles/storage-actions/storage-tasks/storage-task-operations.md

Lines changed: 49 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -21,71 +21,72 @@ An operation is an action that a storage task performs on each object that meets
2121
2222
## Operation format
2323

24-
A storage task contains a set of conditions and operations in a JSON document. The following snippet shows how conditions and operations appear in that document.
25-
26-
```json
27-
"action": {
28-
"if": {
29-
"condition": "<clause>",
30-
"operations": [
31-
{
32-
"name": "<operation name>",
33-
"parameters": {....},
34-
"onSuccess": "continue",
35-
"onFailure": "break"
36-
}
37-
]
38-
}
39-
}
40-
```
41-
42-
Each clause contains a _property_, a _value_, and an _operator_. When the storage task runs, it uses the operator to compare a property with a value to determine whether a clause is met by the target object. In a clause, the **operator** always appears first followed by the **property**, and then the **value**. The following image shows how each element is positioned in the expression.
24+
A storage task contains a set of conditions and operations in a JSON document. The following image shows how a single condition and operation appear in a the document.
4325

4426
> [!div class="mx-imgBorder"]
45-
> ![Format of a simple condition with an operator, property, and value.](../media/storage-tasks/storage-task-conditions/storage-task-conditions-condition-format-basic.png)
27+
> ![Location of conditions and operations in a JSON snippet.](../media/storage-tasks/storage-task-operations/storage-task-operations-location-of-conditions-and-operations.png)
28+
29+
An operation is defined by the following JSON elements:
4630

47-
The following clause allows operations only on Microsoft Word documents. This clause targets all documents that end with the file extension `.docx`. Therefore, the operator is `endsWith`, the property is `Name`, the value is `.docx`.
31+
| Element | Description |
32+
|---|--|
33+
| `name` | The name of the operation. For a full list of names, see the [Supported operations](#supported-operations) section of this article. |
34+
| `parameters` | The names and values of each parameter separated by a comma. To see which parameters are available with each operation, see the [Supported operations](#supported-operations) section of this article. |
35+
| `onSuccess` | The action to take when the operation is successful for an object. `continue` is the only allowable value during the preview. |
36+
| `onFailure` | The action to take when the operation fails for a object. `break` is the only allowable value during the preview. |
4837

49-
```json
50-
{
51-
"condition": "[[[endsWith(Name, '.docx')]]"
52-
}
53-
```
54-
If you define conditions by using the Azure portal, you can see this JSON structure by opening the **Code** tab of the visual designer.
55-
56-
> [!div class="mx-imgBorder"]
57-
> ![Screenshot of the condition JSON as it appears in the Code tab of the visual designer.](../media/storage-tasks/storage-task-conditions/storage-task-conditions-code-tab.png)
58-
59-
### Multiple clauses in a condition
60-
61-
A condition can contain multiple clauses separated by a comma along with either the string `and` or `or`. The string `and` targets objects that meet the criteria in all clauses in the condition while `or` targets objects that meet the criterion in any of the clauses in the condition. The following image shows the position of the `and` and `or` string along with two clauses.
38+
The following image shows where each element appears in the definition.
6239

6340
> [!div class="mx-imgBorder"]
64-
> ![Format of a condition that contains two clauses.](../media/storage-tasks/storage-task-conditions/storage-task-conditions-condition-format-multiple.png)
65-
66-
The following JSON shows a condition that contains two clauses. Because the `and` string is used in this expression, both clauses must evaluate to `true` before an operation is performed on the object.
41+
> ![Format of an operation.](../media/storage-tasks/storage-task-operations/storage-task-operations-basic-structure.png)
42+
43+
The following operations applies applies a time-based immutability policy to the object.
6744

6845
```json
6946
{
70-
"condition": "[[and(endsWith(Name, '.docx'), equals(Tags.Value[readyForLegalHold], 'Yes'))]]"
47+
"operations": [
48+
{
49+
"name": "SetBlobImmutabilityPolicy",
50+
"parameters": {
51+
"untilDate": "2024-11-15T21:54:22",
52+
"mode": "locked"
53+
},
54+
"onSuccess": "continue",
55+
"onFailure": "break"
56+
}
57+
]
7158
}
7259
```
7360

74-
### Groups of conditions
61+
### Multiple operations
7562

76-
Grouped clauses operate as a single unit separate from the rest of the clauses. Grouping clauses is similar to putting parentheses around a mathematical equation or logic expression. The `and` or `or` string for the first clause in the group applies to the whole group.
77-
78-
The following image shows two clauses grouped together.
63+
Separate multiple operations by using a comma. The following image shows the position of two operations in list of operations.
7964

8065
> [!div class="mx-imgBorder"]
81-
> ![Format of a condition that contains two clauses grouped together.](../media/storage-tasks/storage-task-conditions/storage-task-conditions-condition-format-groups.png)
66+
> ![Format of two operations.](../media/storage-tasks/storage-task-operations/storage-task-operations-mulitple-operations.png)
8267
83-
The following condition allows operations only on Microsoft Word documents where the `readyForLegalHold` tag of the document is set to a value of `Yes`. Operations are also performed on objects that are greater than 100 bytes even if the other two conditions are not true.
68+
The following JSON shows two operations separate by a comma.
8469

8570
```json
86-
{
87-
"condition": "[[[or(and(endsWith(Name, '.docx'), equals(Tags.Value[readyForLegalHold], 'Yes')), greater(Content-Length, '100'))]]"
88-
}
71+
"operations": [
72+
{
73+
"name": "SetBlobImmutabilityPolicy",
74+
"parameters": {
75+
"untilDate": "2024-11-15T21:54:22",
76+
"mode": "unlocked"
77+
},
78+
"onSuccess": "continue",
79+
"onFailure": "break"
80+
},
81+
{
82+
"name": "SetBlobTags",
83+
"parameters": {
84+
"ImmutabilityUpdatedBy": "contosoStorageTask"
85+
},
86+
"onSuccess": "continue",
87+
"onFailure": "break"
88+
}
89+
]
8990
```
9091

9192
## Supported operations
@@ -102,26 +103,7 @@ The following table shows the supported operations, parameters, and parameter va
102103
| Set blob immutability policy | DateTime, string | DateTime of when policy ends, Locked \| Unlocked |
103104
| Set blob legal hold | Bool | True \| False |
104105

105-
## Example 1
106-
107-
Example here.
108-
109-
```json
110-
{
111-
Put Json here
112-
}
113-
```
114-
115-
## Example 3
116-
117-
Example here.
118-
119-
```json
120-
{
121-
Put Json here
122-
}
123-
```
124-
125106
## See also
126107

108+
- [Storage task conditions](storage-task-conditions.md)
127109
- [Define conditions and operations](storage-task-conditions-operations-edit.md)

0 commit comments

Comments
 (0)