Skip to content

Commit 6784457

Browse files
Readme update.
1 parent a26b706 commit 6784457

File tree

1 file changed

+46
-2
lines changed
  • experiments/Azure.Experiments/Azure.Experiments

1 file changed

+46
-2
lines changed
Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Stages
1+
## Stages
22

33
1. Get a current Azure state. Each resource has a function to get information from Azure.
44
The function is an asynchronous operation.
@@ -7,4 +7,48 @@
77
All decisions has to be made on this stage.
88
3. Create a graph of create/update operations. This operation is synchronous.
99
4. Execute the graph. This operation is asynchronous and may require a progress bar, AsJob etc.
10-
It can also create several resources simultaneously.
10+
It can also create several resources simultaneously.
11+
12+
## Policies
13+
14+
```cs
15+
interface IInfoMap
16+
{
17+
Info Get<Info>(IResourcePolicy<Info> info)
18+
where Info : class;
19+
}
20+
interface IResourcePolicy
21+
{
22+
}
23+
interface IResourcePolicy<Info> : IResourcePolicy
24+
where Info : class
25+
{
26+
IEnumerable<IResourcePolicy> Dependencies { get; }
27+
string GetLocation(Info info);
28+
Task<Info> CreateAsync(Context context, Info info);
29+
}
30+
interface IResourcePolicy<Info, Id> : IResourcePolicy<Info>
31+
where Info : class
32+
{
33+
Task<Info> GetAsync(Context context, Id id);
34+
}
35+
sealed class ManagedResourceId
36+
{
37+
string ResourceGroupName { get; }
38+
string Name { get; }
39+
}
40+
interface IManagedResourcePolicy<Info> : IResource<Info, ManagedResourceId>
41+
{
42+
ResourceGroupPolicy
43+
void UpdateInfo(Info info, IInfoMap infoMap);
44+
}
45+
interface IResourceGroupPolicy : IResourcePolicy<ResourceGroup, string>
46+
{
47+
}
48+
interface ISubresource<Info, ParentInfo> : IResource
49+
{
50+
IResource<ParentInfo> Parent { get; }
51+
Info Get(ParentInfo parentInfo);
52+
void Set(ParentInfo info, Info info);
53+
}
54+
```

0 commit comments

Comments
 (0)