Skip to content

Commit

Permalink
Readme update.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar committed Nov 3, 2017
1 parent a26b706 commit 6784457
Showing 1 changed file with 46 additions and 2 deletions.
48 changes: 46 additions & 2 deletions experiments/Azure.Experiments/Azure.Experiments/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Stages
## Stages

1. Get a current Azure state. Each resource has a function to get information from Azure.
The function is an asynchronous operation.
Expand All @@ -7,4 +7,48 @@
All decisions has to be made on this stage.
3. Create a graph of create/update operations. This operation is synchronous.
4. Execute the graph. This operation is asynchronous and may require a progress bar, AsJob etc.
It can also create several resources simultaneously.
It can also create several resources simultaneously.

## Policies

```cs
interface IInfoMap
{
Info Get<Info>(IResourcePolicy<Info> info)
where Info : class;
}
interface IResourcePolicy
{
}
interface IResourcePolicy<Info> : IResourcePolicy
where Info : class
{
IEnumerable<IResourcePolicy> Dependencies { get; }
string GetLocation(Info info);
Task<Info> CreateAsync(Context context, Info info);
}
interface IResourcePolicy<Info, Id> : IResourcePolicy<Info>
where Info : class
{
Task<Info> GetAsync(Context context, Id id);
}
sealed class ManagedResourceId
{
string ResourceGroupName { get; }
string Name { get; }
}
interface IManagedResourcePolicy<Info> : IResource<Info, ManagedResourceId>
{
ResourceGroupPolicy
void UpdateInfo(Info info, IInfoMap infoMap);
}
interface IResourceGroupPolicy : IResourcePolicy<ResourceGroup, string>
{
}
interface ISubresource<Info, ParentInfo> : IResource
{
IResource<ParentInfo> Parent { get; }
Info Get(ParentInfo parentInfo);
void Set(ParentInfo info, Info info);
}
```

0 comments on commit 6784457

Please sign in to comment.