-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
AzureBlobFileSystemConfiguration.cs
243 lines (215 loc) · 10.9 KB
/
AzureBlobFileSystemConfiguration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
//
// This file was autogenerated by a tool.
// Do not modify it.
//
namespace Microsoft.Azure.Batch
{
using Models = Microsoft.Azure.Batch.Protocol.Models;
using System;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Information used to connect to an Azure Storage Container using Blobfuse.
/// </summary>
public partial class AzureBlobFileSystemConfiguration : ITransportObjectProvider<Models.AzureBlobFileSystemConfiguration>, IPropertyMetadata
{
private class PropertyContainer : PropertyCollection
{
public readonly PropertyAccessor<string> AccountKeyProperty;
public readonly PropertyAccessor<string> AccountNameProperty;
public readonly PropertyAccessor<string> BlobfuseOptionsProperty;
public readonly PropertyAccessor<string> ContainerNameProperty;
public readonly PropertyAccessor<ComputeNodeIdentityReference> IdentityReferenceProperty;
public readonly PropertyAccessor<string> RelativeMountPathProperty;
public readonly PropertyAccessor<string> SasKeyProperty;
public PropertyContainer() : base(BindingState.Unbound)
{
this.AccountKeyProperty = this.CreatePropertyAccessor<string>(nameof(AccountKey), BindingAccess.Read | BindingAccess.Write);
this.AccountNameProperty = this.CreatePropertyAccessor<string>(nameof(AccountName), BindingAccess.Read | BindingAccess.Write);
this.BlobfuseOptionsProperty = this.CreatePropertyAccessor<string>(nameof(BlobfuseOptions), BindingAccess.Read | BindingAccess.Write);
this.ContainerNameProperty = this.CreatePropertyAccessor<string>(nameof(ContainerName), BindingAccess.Read | BindingAccess.Write);
this.IdentityReferenceProperty = this.CreatePropertyAccessor<ComputeNodeIdentityReference>(nameof(IdentityReference), BindingAccess.Read | BindingAccess.Write);
this.RelativeMountPathProperty = this.CreatePropertyAccessor<string>(nameof(RelativeMountPath), BindingAccess.Read | BindingAccess.Write);
this.SasKeyProperty = this.CreatePropertyAccessor<string>(nameof(SasKey), BindingAccess.Read | BindingAccess.Write);
}
public PropertyContainer(Models.AzureBlobFileSystemConfiguration protocolObject) : base(BindingState.Bound)
{
this.AccountKeyProperty = this.CreatePropertyAccessor(
protocolObject.AccountKey,
nameof(AccountKey),
BindingAccess.Read);
this.AccountNameProperty = this.CreatePropertyAccessor(
protocolObject.AccountName,
nameof(AccountName),
BindingAccess.Read);
this.BlobfuseOptionsProperty = this.CreatePropertyAccessor(
protocolObject.BlobfuseOptions,
nameof(BlobfuseOptions),
BindingAccess.Read);
this.ContainerNameProperty = this.CreatePropertyAccessor(
protocolObject.ContainerName,
nameof(ContainerName),
BindingAccess.Read);
this.IdentityReferenceProperty = this.CreatePropertyAccessor(
UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.IdentityReference, o => new ComputeNodeIdentityReference(o).Freeze()),
nameof(IdentityReference),
BindingAccess.Read);
this.RelativeMountPathProperty = this.CreatePropertyAccessor(
protocolObject.RelativeMountPath,
nameof(RelativeMountPath),
BindingAccess.Read);
this.SasKeyProperty = this.CreatePropertyAccessor(
protocolObject.SasKey,
nameof(SasKey),
BindingAccess.Read);
}
}
private readonly PropertyContainer propertyContainer;
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="AzureBlobFileSystemConfiguration"/> class.
/// </summary>
/// <param name='accountName'>The Azure Storage account name.</param>
/// <param name='containerName'>The Azure Blob Storage Container name.</param>
/// <param name='relativeMountPath'>The relative path on the compute node where the file system will be mounted.</param>
/// <param name='accountKey'>The Azure Storage Account key. This property is mutually exclusive with <see cref="SasKey"/>.</param>
/// <param name='sasKey'>The Azure Storage SAS token. This property is mutually exclusive with <see cref="AccountKey"/>.</param>
/// <param name='blobfuseOptions'>Additional command line options to pass to the mount command.</param>
/// <param name='identityReference'>The reference to the user assigned identity to use to access containerName</param>
internal AzureBlobFileSystemConfiguration(
string accountName,
string containerName,
string relativeMountPath,
string accountKey = default(string),
string sasKey = default(string),
string blobfuseOptions = default(string),
ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference))
{
this.propertyContainer = new PropertyContainer();
this.AccountName = accountName;
this.ContainerName = containerName;
this.RelativeMountPath = relativeMountPath;
this.AccountKey = accountKey;
this.SasKey = sasKey;
this.BlobfuseOptions = blobfuseOptions;
this.IdentityReference = identityReference;
}
/// <summary>
/// Default constructor to support mocking the <see cref="AzureBlobFileSystemConfiguration"/> class.
/// </summary>
protected AzureBlobFileSystemConfiguration()
{
this.propertyContainer = new PropertyContainer();
}
internal AzureBlobFileSystemConfiguration(Models.AzureBlobFileSystemConfiguration protocolObject)
{
this.propertyContainer = new PropertyContainer(protocolObject);
}
#endregion Constructors
#region AzureBlobFileSystemConfiguration
/// <summary>
/// Gets the Azure Storage Account key. This property is mutually exclusive with <see cref="SasKey"/>.
/// </summary>
public string AccountKey
{
get { return this.propertyContainer.AccountKeyProperty.Value; }
private set { this.propertyContainer.AccountKeyProperty.Value = value; }
}
/// <summary>
/// Gets the Azure Storage account name.
/// </summary>
public string AccountName
{
get { return this.propertyContainer.AccountNameProperty.Value; }
private set { this.propertyContainer.AccountNameProperty.Value = value; }
}
/// <summary>
/// Gets additional command line options to pass to the mount command.
/// </summary>
/// <remarks>
/// These are 'net use' options in Windows and 'mount' options in Linux.
/// </remarks>
public string BlobfuseOptions
{
get { return this.propertyContainer.BlobfuseOptionsProperty.Value; }
private set { this.propertyContainer.BlobfuseOptionsProperty.Value = value; }
}
/// <summary>
/// Gets the Azure Blob Storage Container name.
/// </summary>
public string ContainerName
{
get { return this.propertyContainer.ContainerNameProperty.Value; }
private set { this.propertyContainer.ContainerNameProperty.Value = value; }
}
/// <summary>
/// Gets or sets the reference to the user assigned identity to use to access containerName
/// </summary>
/// <remarks>
/// This property is mutually exclusive with both accountKey and sasKey; exactly one must be specified.
/// </remarks>
public ComputeNodeIdentityReference IdentityReference
{
get { return this.propertyContainer.IdentityReferenceProperty.Value; }
set { this.propertyContainer.IdentityReferenceProperty.Value = value; }
}
/// <summary>
/// Gets the relative path on the compute node where the file system will be mounted.
/// </summary>
/// <remarks>
/// All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR
/// environment variable.
/// </remarks>
public string RelativeMountPath
{
get { return this.propertyContainer.RelativeMountPathProperty.Value; }
private set { this.propertyContainer.RelativeMountPathProperty.Value = value; }
}
/// <summary>
/// Gets the Azure Storage SAS token. This property is mutually exclusive with <see cref="AccountKey"/>.
/// </summary>
public string SasKey
{
get { return this.propertyContainer.SasKeyProperty.Value; }
private set { this.propertyContainer.SasKeyProperty.Value = value; }
}
#endregion // AzureBlobFileSystemConfiguration
#region IPropertyMetadata
bool IModifiable.HasBeenModified
{
get { return this.propertyContainer.HasBeenModified; }
}
bool IReadOnly.IsReadOnly
{
get { return this.propertyContainer.IsReadOnly; }
set { this.propertyContainer.IsReadOnly = value; }
}
#endregion //IPropertyMetadata
#region Internal/private methods
/// <summary>
/// Return a protocol object of the requested type.
/// </summary>
/// <returns>The protocol object of the requested type.</returns>
Models.AzureBlobFileSystemConfiguration ITransportObjectProvider<Models.AzureBlobFileSystemConfiguration>.GetTransportObject()
{
Models.AzureBlobFileSystemConfiguration result = new Models.AzureBlobFileSystemConfiguration()
{
AccountKey = this.AccountKey,
AccountName = this.AccountName,
BlobfuseOptions = this.BlobfuseOptions,
ContainerName = this.ContainerName,
IdentityReference = UtilitiesInternal.CreateObjectWithNullCheck(this.IdentityReference, (o) => o.GetTransportObject()),
RelativeMountPath = this.RelativeMountPath,
SasKey = this.SasKey,
};
return result;
}
#endregion // Internal/private methods
}
}