PageRenderTime 823ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 1ms

/vendor/github.com/Azure/azure-sdk-for-go/services/datalake/store/2016-11-01/filesystem/filesystem.go

https://gitlab.com/unofficial-mirrors/openshift-origin
Go | 1099 lines | 757 code | 135 blank | 207 comment | 114 complexity | 3b606520a112b0a00763489e0d49d34f MD5 | raw file
  1. package filesystem
  2. // Copyright (c) Microsoft and contributors. All rights reserved.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. //
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. // Code generated by Microsoft (R) AutoRest Code Generator.
  17. // Changes may cause incorrect behavior and will be lost if the code is regenerated.
  18. import (
  19. "context"
  20. "github.com/Azure/go-autorest/autorest"
  21. "github.com/Azure/go-autorest/autorest/azure"
  22. "github.com/Azure/go-autorest/autorest/validation"
  23. "github.com/satori/go.uuid"
  24. "io"
  25. "net/http"
  26. )
  27. // Client is the creates an Azure Data Lake Store filesystem client.
  28. type Client struct {
  29. BaseClient
  30. }
  31. // NewClient creates an instance of the Client client.
  32. func NewClient() Client {
  33. return Client{New()}
  34. }
  35. // Append used for serial appends to the specified file. NOTE: The target must not contain data added by
  36. // ConcurrentAppend. ConcurrentAppend and Append cannot be used interchangeably; once a target file has been modified
  37. // using either of these append options, the other append option cannot be used on the target file.
  38. //
  39. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  40. // Store path (starting with '/') of the file to which to append. streamContents is the file contents to include when
  41. // appending to the file. streamContents will be closed upon successful return. Callers should ensure closure when
  42. // receiving an error.appendParameter is flag to skip redirection. When append=false or not specified, the request is
  43. // redirected. Submit another HTTP PUT request using the URL in the Location header with the file data to be written.
  44. // When append=true, this redirection is skipped. op is the constant value for the operation. offset is the optional
  45. // offset in the stream to begin the append operation. Default is to append at the end of the stream. syncFlag is
  46. // optionally indicates what to do after completion of the concurrent append. DATA indicates that more data will be
  47. // sent immediately by the client, the file handle should remain open/locked, and file metadata (including file length,
  48. // last modified time) should NOT get updated. METADATA indicates that more data will be sent immediately by the
  49. // client, the file handle should remain open/locked, and file metadata should get updated. CLOSE indicates that the
  50. // client is done sending data, the file handle should be closed/unlocked, and file metadata should get updated.
  51. // leaseID is optional unique GUID per file to ensure single writer semantics, meaning that only clients that append to
  52. // the file with the same leaseId will be allowed to do so. fileSessionID is optional unique GUID per file indicating
  53. // all the appends with the same fileSessionId are from the same client and same session. This will give a performance
  54. // benefit when syncFlag is DATA or METADATA.
  55. func (client Client) Append(ctx context.Context, accountName string, pathParameter string, streamContents io.ReadCloser, appendParameter string, op string, offset *int64, syncFlag SyncFlag, leaseID *uuid.UUID, fileSessionID *uuid.UUID) (result autorest.Response, err error) {
  56. req, err := client.AppendPreparer(ctx, accountName, pathParameter, streamContents, appendParameter, op, offset, syncFlag, leaseID, fileSessionID)
  57. if err != nil {
  58. err = autorest.NewErrorWithError(err, "filesystem.Client", "Append", nil, "Failure preparing request")
  59. return
  60. }
  61. resp, err := client.AppendSender(req)
  62. if err != nil {
  63. result.Response = resp
  64. err = autorest.NewErrorWithError(err, "filesystem.Client", "Append", resp, "Failure sending request")
  65. return
  66. }
  67. result, err = client.AppendResponder(resp)
  68. if err != nil {
  69. err = autorest.NewErrorWithError(err, "filesystem.Client", "Append", resp, "Failure responding to request")
  70. }
  71. return
  72. }
  73. // AppendPreparer prepares the Append request.
  74. func (client Client) AppendPreparer(ctx context.Context, accountName string, pathParameter string, streamContents io.ReadCloser, appendParameter string, op string, offset *int64, syncFlag SyncFlag, leaseID *uuid.UUID, fileSessionID *uuid.UUID) (*http.Request, error) {
  75. urlParameters := map[string]interface{}{
  76. "accountName": accountName,
  77. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  78. }
  79. pathParameters := map[string]interface{}{
  80. "path": autorest.Encode("path", pathParameter),
  81. }
  82. const APIVersion = "2016-11-01"
  83. queryParameters := map[string]interface{}{
  84. "api-version": APIVersion,
  85. "append": autorest.Encode("query", appendParameter),
  86. "op": autorest.Encode("query", op),
  87. }
  88. if offset != nil {
  89. queryParameters["offset"] = autorest.Encode("query", *offset)
  90. }
  91. if len(string(syncFlag)) > 0 {
  92. queryParameters["syncFlag"] = autorest.Encode("query", syncFlag)
  93. }
  94. if leaseID != nil {
  95. queryParameters["leaseId"] = autorest.Encode("query", *leaseID)
  96. }
  97. if fileSessionID != nil {
  98. queryParameters["fileSessionId"] = autorest.Encode("query", *fileSessionID)
  99. }
  100. preparer := autorest.CreatePreparer(
  101. autorest.AsPost(),
  102. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  103. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  104. autorest.WithFile(streamContents),
  105. autorest.WithQueryParameters(queryParameters))
  106. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  107. }
  108. // AppendSender sends the Append request. The method will close the
  109. // http.Response Body if it receives an error.
  110. func (client Client) AppendSender(req *http.Request) (*http.Response, error) {
  111. return autorest.SendWithSender(client, req,
  112. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  113. }
  114. // AppendResponder handles the response to the Append request. The method always
  115. // closes the http.Response Body.
  116. func (client Client) AppendResponder(resp *http.Response) (result autorest.Response, err error) {
  117. err = autorest.Respond(
  118. resp,
  119. client.ByInspecting(),
  120. azure.WithErrorUnlessStatusCode(http.StatusOK),
  121. autorest.ByClosing())
  122. result.Response = resp
  123. return
  124. }
  125. // CheckAccess checks if the specified access is available at the given path.
  126. //
  127. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  128. // Store path (starting with '/') of the file or directory for which to check access. fsaction is file system operation
  129. // read/write/execute in string form, matching regex pattern '[rwx-]{3}' op is the constant value for the operation.
  130. func (client Client) CheckAccess(ctx context.Context, accountName string, pathParameter string, fsaction string, op string) (result autorest.Response, err error) {
  131. req, err := client.CheckAccessPreparer(ctx, accountName, pathParameter, fsaction, op)
  132. if err != nil {
  133. err = autorest.NewErrorWithError(err, "filesystem.Client", "CheckAccess", nil, "Failure preparing request")
  134. return
  135. }
  136. resp, err := client.CheckAccessSender(req)
  137. if err != nil {
  138. result.Response = resp
  139. err = autorest.NewErrorWithError(err, "filesystem.Client", "CheckAccess", resp, "Failure sending request")
  140. return
  141. }
  142. result, err = client.CheckAccessResponder(resp)
  143. if err != nil {
  144. err = autorest.NewErrorWithError(err, "filesystem.Client", "CheckAccess", resp, "Failure responding to request")
  145. }
  146. return
  147. }
  148. // CheckAccessPreparer prepares the CheckAccess request.
  149. func (client Client) CheckAccessPreparer(ctx context.Context, accountName string, pathParameter string, fsaction string, op string) (*http.Request, error) {
  150. urlParameters := map[string]interface{}{
  151. "accountName": accountName,
  152. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  153. }
  154. pathParameters := map[string]interface{}{
  155. "path": autorest.Encode("path", pathParameter),
  156. }
  157. const APIVersion = "2016-11-01"
  158. queryParameters := map[string]interface{}{
  159. "api-version": APIVersion,
  160. "fsaction": autorest.Encode("query", fsaction),
  161. "op": autorest.Encode("query", op),
  162. }
  163. preparer := autorest.CreatePreparer(
  164. autorest.AsGet(),
  165. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  166. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  167. autorest.WithQueryParameters(queryParameters))
  168. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  169. }
  170. // CheckAccessSender sends the CheckAccess request. The method will close the
  171. // http.Response Body if it receives an error.
  172. func (client Client) CheckAccessSender(req *http.Request) (*http.Response, error) {
  173. return autorest.SendWithSender(client, req,
  174. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  175. }
  176. // CheckAccessResponder handles the response to the CheckAccess request. The method always
  177. // closes the http.Response Body.
  178. func (client Client) CheckAccessResponder(resp *http.Response) (result autorest.Response, err error) {
  179. err = autorest.Respond(
  180. resp,
  181. client.ByInspecting(),
  182. azure.WithErrorUnlessStatusCode(http.StatusOK),
  183. autorest.ByClosing())
  184. result.Response = resp
  185. return
  186. }
  187. // Concat concatenates the list of source files into the destination file, removing all source files upon success.
  188. //
  189. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  190. // Store path (starting with '/') of the destination file resulting from the concatenation. sources is a list of comma
  191. // separated Data Lake Store paths (starting with '/') of the files to concatenate, in the order in which they should
  192. // be concatenated. op is the constant value for the operation.
  193. func (client Client) Concat(ctx context.Context, accountName string, pathParameter string, sources []string, op string) (result autorest.Response, err error) {
  194. if err := validation.Validate([]validation.Validation{
  195. {TargetValue: sources,
  196. Constraints: []validation.Constraint{{Target: "sources", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
  197. return result, validation.NewErrorWithValidationError(err, "filesystem.Client", "Concat")
  198. }
  199. req, err := client.ConcatPreparer(ctx, accountName, pathParameter, sources, op)
  200. if err != nil {
  201. err = autorest.NewErrorWithError(err, "filesystem.Client", "Concat", nil, "Failure preparing request")
  202. return
  203. }
  204. resp, err := client.ConcatSender(req)
  205. if err != nil {
  206. result.Response = resp
  207. err = autorest.NewErrorWithError(err, "filesystem.Client", "Concat", resp, "Failure sending request")
  208. return
  209. }
  210. result, err = client.ConcatResponder(resp)
  211. if err != nil {
  212. err = autorest.NewErrorWithError(err, "filesystem.Client", "Concat", resp, "Failure responding to request")
  213. }
  214. return
  215. }
  216. // ConcatPreparer prepares the Concat request.
  217. func (client Client) ConcatPreparer(ctx context.Context, accountName string, pathParameter string, sources []string, op string) (*http.Request, error) {
  218. urlParameters := map[string]interface{}{
  219. "accountName": accountName,
  220. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  221. }
  222. pathParameters := map[string]interface{}{
  223. "path": autorest.Encode("path", pathParameter),
  224. }
  225. const APIVersion = "2016-11-01"
  226. queryParameters := map[string]interface{}{
  227. "api-version": APIVersion,
  228. "op": autorest.Encode("query", op),
  229. "sources": autorest.Encode("query", sources, ","),
  230. }
  231. preparer := autorest.CreatePreparer(
  232. autorest.AsPost(),
  233. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  234. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  235. autorest.WithQueryParameters(queryParameters))
  236. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  237. }
  238. // ConcatSender sends the Concat request. The method will close the
  239. // http.Response Body if it receives an error.
  240. func (client Client) ConcatSender(req *http.Request) (*http.Response, error) {
  241. return autorest.SendWithSender(client, req,
  242. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  243. }
  244. // ConcatResponder handles the response to the Concat request. The method always
  245. // closes the http.Response Body.
  246. func (client Client) ConcatResponder(resp *http.Response) (result autorest.Response, err error) {
  247. err = autorest.Respond(
  248. resp,
  249. client.ByInspecting(),
  250. azure.WithErrorUnlessStatusCode(http.StatusOK),
  251. autorest.ByClosing())
  252. result.Response = resp
  253. return
  254. }
  255. // ConcurrentAppend appends to the specified file, optionally first creating the file if it does not yet exist. This
  256. // method supports multiple concurrent appends to the file. NOTE: The target must not contain data added by Create or
  257. // normal (serial) Append. ConcurrentAppend and Append cannot be used interchangeably; once a target file has been
  258. // modified using either of these append options, the other append option cannot be used on the target file.
  259. // ConcurrentAppend does not guarantee order and can result in duplicated data landing in the target file.
  260. //
  261. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  262. // Store path (starting with '/') of the file to which to append using concurrent append. streamContents is the file
  263. // contents to include when appending to the file. streamContents will be closed upon successful return. Callers should
  264. // ensure closure when receiving an error.op is the constant value for the operation. transferEncoding is indicates the
  265. // data being sent to the server is being streamed in chunks. appendMode is indicates the concurrent append call should
  266. // create the file if it doesn't exist or just open the existing file for append syncFlag is optionally indicates what
  267. // to do after completion of the concurrent append. DATA indicates that more data will be sent immediately by the
  268. // client, the file handle should remain open/locked, and file metadata (including file length, last modified time)
  269. // should NOT get updated. METADATA indicates that more data will be sent immediately by the client, the file handle
  270. // should remain open/locked, and file metadata should get updated. CLOSE indicates that the client is done sending
  271. // data, the file handle should be closed/unlocked, and file metadata should get updated.
  272. func (client Client) ConcurrentAppend(ctx context.Context, accountName string, pathParameter string, streamContents io.ReadCloser, op string, transferEncoding string, appendMode AppendModeType, syncFlag SyncFlag) (result autorest.Response, err error) {
  273. req, err := client.ConcurrentAppendPreparer(ctx, accountName, pathParameter, streamContents, op, transferEncoding, appendMode, syncFlag)
  274. if err != nil {
  275. err = autorest.NewErrorWithError(err, "filesystem.Client", "ConcurrentAppend", nil, "Failure preparing request")
  276. return
  277. }
  278. resp, err := client.ConcurrentAppendSender(req)
  279. if err != nil {
  280. result.Response = resp
  281. err = autorest.NewErrorWithError(err, "filesystem.Client", "ConcurrentAppend", resp, "Failure sending request")
  282. return
  283. }
  284. result, err = client.ConcurrentAppendResponder(resp)
  285. if err != nil {
  286. err = autorest.NewErrorWithError(err, "filesystem.Client", "ConcurrentAppend", resp, "Failure responding to request")
  287. }
  288. return
  289. }
  290. // ConcurrentAppendPreparer prepares the ConcurrentAppend request.
  291. func (client Client) ConcurrentAppendPreparer(ctx context.Context, accountName string, pathParameter string, streamContents io.ReadCloser, op string, transferEncoding string, appendMode AppendModeType, syncFlag SyncFlag) (*http.Request, error) {
  292. urlParameters := map[string]interface{}{
  293. "accountName": accountName,
  294. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  295. }
  296. pathParameters := map[string]interface{}{
  297. "path": autorest.Encode("path", pathParameter),
  298. }
  299. const APIVersion = "2016-11-01"
  300. queryParameters := map[string]interface{}{
  301. "api-version": APIVersion,
  302. "op": autorest.Encode("query", op),
  303. }
  304. if len(string(appendMode)) > 0 {
  305. queryParameters["appendMode"] = autorest.Encode("query", appendMode)
  306. }
  307. if len(string(syncFlag)) > 0 {
  308. queryParameters["syncFlag"] = autorest.Encode("query", syncFlag)
  309. }
  310. preparer := autorest.CreatePreparer(
  311. autorest.AsPost(),
  312. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  313. autorest.WithPathParameters("/WebHdfsExt/{path}", pathParameters),
  314. autorest.WithFile(streamContents),
  315. autorest.WithQueryParameters(queryParameters),
  316. autorest.WithHeader("Transfer-Encoding", autorest.String(transferEncoding)))
  317. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  318. }
  319. // ConcurrentAppendSender sends the ConcurrentAppend request. The method will close the
  320. // http.Response Body if it receives an error.
  321. func (client Client) ConcurrentAppendSender(req *http.Request) (*http.Response, error) {
  322. return autorest.SendWithSender(client, req,
  323. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  324. }
  325. // ConcurrentAppendResponder handles the response to the ConcurrentAppend request. The method always
  326. // closes the http.Response Body.
  327. func (client Client) ConcurrentAppendResponder(resp *http.Response) (result autorest.Response, err error) {
  328. err = autorest.Respond(
  329. resp,
  330. client.ByInspecting(),
  331. azure.WithErrorUnlessStatusCode(http.StatusOK),
  332. autorest.ByClosing())
  333. result.Response = resp
  334. return
  335. }
  336. // Create creates a file with optionally specified content. NOTE: If content is provided, the resulting file cannot be
  337. // modified using ConcurrentAppend.
  338. //
  339. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  340. // Store path (starting with '/') of the file to create. write is flag to skip redirection. When write=false or not
  341. // specified, the request is redirected. Submit another HTTP PUT request using the URL in the Location header with the
  342. // file data to be written. When write=true, this redirection is skipped. op is the constant value for the operation.
  343. // streamContents is the file contents to include when creating the file. This parameter is optional, resulting in an
  344. // empty file if not specified. streamContents will be closed upon successful return. Callers should ensure closure
  345. // when receiving an error.overwrite is the indication of if the file should be overwritten. syncFlag is optionally
  346. // indicates what to do after completion of the create. DATA indicates that more data will be sent immediately by the
  347. // client, the file handle should remain open/locked, and file metadata (including file length, last modified time)
  348. // should NOT get updated. METADATA indicates that more data will be sent immediately by the client, the file handle
  349. // should remain open/locked, and file metadata should get updated. CLOSE indicates that the client is done sending
  350. // data, the file handle should be closed/unlocked, and file metadata should get updated. leaseID is optional unique
  351. // GUID per file to ensure single writer semantics, meaning that only clients that append to the file with the same
  352. // leaseId will be allowed to do so. permission is the octal representation of the unnamed user, mask and other
  353. // permissions that should be set for the file when created. If not specified, it inherits these from the container.
  354. func (client Client) Create(ctx context.Context, accountName string, pathParameter string, write string, op string, streamContents io.ReadCloser, overwrite *bool, syncFlag SyncFlag, leaseID *uuid.UUID, permission *int32) (result autorest.Response, err error) {
  355. req, err := client.CreatePreparer(ctx, accountName, pathParameter, write, op, streamContents, overwrite, syncFlag, leaseID, permission)
  356. if err != nil {
  357. err = autorest.NewErrorWithError(err, "filesystem.Client", "Create", nil, "Failure preparing request")
  358. return
  359. }
  360. resp, err := client.CreateSender(req)
  361. if err != nil {
  362. result.Response = resp
  363. err = autorest.NewErrorWithError(err, "filesystem.Client", "Create", resp, "Failure sending request")
  364. return
  365. }
  366. result, err = client.CreateResponder(resp)
  367. if err != nil {
  368. err = autorest.NewErrorWithError(err, "filesystem.Client", "Create", resp, "Failure responding to request")
  369. }
  370. return
  371. }
  372. // CreatePreparer prepares the Create request.
  373. func (client Client) CreatePreparer(ctx context.Context, accountName string, pathParameter string, write string, op string, streamContents io.ReadCloser, overwrite *bool, syncFlag SyncFlag, leaseID *uuid.UUID, permission *int32) (*http.Request, error) {
  374. urlParameters := map[string]interface{}{
  375. "accountName": accountName,
  376. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  377. }
  378. pathParameters := map[string]interface{}{
  379. "path": autorest.Encode("path", pathParameter),
  380. }
  381. const APIVersion = "2016-11-01"
  382. queryParameters := map[string]interface{}{
  383. "api-version": APIVersion,
  384. "op": autorest.Encode("query", op),
  385. "write": autorest.Encode("query", write),
  386. }
  387. if overwrite != nil {
  388. queryParameters["overwrite"] = autorest.Encode("query", *overwrite)
  389. }
  390. if len(string(syncFlag)) > 0 {
  391. queryParameters["syncFlag"] = autorest.Encode("query", syncFlag)
  392. }
  393. if leaseID != nil {
  394. queryParameters["leaseId"] = autorest.Encode("query", *leaseID)
  395. }
  396. if permission != nil {
  397. queryParameters["permission"] = autorest.Encode("query", *permission)
  398. }
  399. preparer := autorest.CreatePreparer(
  400. autorest.AsPut(),
  401. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  402. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  403. autorest.WithQueryParameters(queryParameters))
  404. if streamContents != nil {
  405. preparer = autorest.DecoratePreparer(preparer,
  406. autorest.WithJSON(streamContents))
  407. }
  408. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  409. }
  410. // CreateSender sends the Create request. The method will close the
  411. // http.Response Body if it receives an error.
  412. func (client Client) CreateSender(req *http.Request) (*http.Response, error) {
  413. return autorest.SendWithSender(client, req,
  414. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  415. }
  416. // CreateResponder handles the response to the Create request. The method always
  417. // closes the http.Response Body.
  418. func (client Client) CreateResponder(resp *http.Response) (result autorest.Response, err error) {
  419. err = autorest.Respond(
  420. resp,
  421. client.ByInspecting(),
  422. azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
  423. autorest.ByClosing())
  424. result.Response = resp
  425. return
  426. }
  427. // Delete deletes the requested file or directory, optionally recursively.
  428. //
  429. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  430. // Store path (starting with '/') of the file or directory to delete. op is the constant value for the operation.
  431. // recursive is the optional switch indicating if the delete should be recursive
  432. func (client Client) Delete(ctx context.Context, accountName string, pathParameter string, op string, recursive *bool) (result FileOperationResult, err error) {
  433. req, err := client.DeletePreparer(ctx, accountName, pathParameter, op, recursive)
  434. if err != nil {
  435. err = autorest.NewErrorWithError(err, "filesystem.Client", "Delete", nil, "Failure preparing request")
  436. return
  437. }
  438. resp, err := client.DeleteSender(req)
  439. if err != nil {
  440. result.Response = autorest.Response{Response: resp}
  441. err = autorest.NewErrorWithError(err, "filesystem.Client", "Delete", resp, "Failure sending request")
  442. return
  443. }
  444. result, err = client.DeleteResponder(resp)
  445. if err != nil {
  446. err = autorest.NewErrorWithError(err, "filesystem.Client", "Delete", resp, "Failure responding to request")
  447. }
  448. return
  449. }
  450. // DeletePreparer prepares the Delete request.
  451. func (client Client) DeletePreparer(ctx context.Context, accountName string, pathParameter string, op string, recursive *bool) (*http.Request, error) {
  452. urlParameters := map[string]interface{}{
  453. "accountName": accountName,
  454. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  455. }
  456. pathParameters := map[string]interface{}{
  457. "path": autorest.Encode("path", pathParameter),
  458. }
  459. const APIVersion = "2016-11-01"
  460. queryParameters := map[string]interface{}{
  461. "api-version": APIVersion,
  462. "op": autorest.Encode("query", op),
  463. }
  464. if recursive != nil {
  465. queryParameters["recursive"] = autorest.Encode("query", *recursive)
  466. }
  467. preparer := autorest.CreatePreparer(
  468. autorest.AsDelete(),
  469. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  470. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  471. autorest.WithQueryParameters(queryParameters))
  472. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  473. }
  474. // DeleteSender sends the Delete request. The method will close the
  475. // http.Response Body if it receives an error.
  476. func (client Client) DeleteSender(req *http.Request) (*http.Response, error) {
  477. return autorest.SendWithSender(client, req,
  478. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  479. }
  480. // DeleteResponder handles the response to the Delete request. The method always
  481. // closes the http.Response Body.
  482. func (client Client) DeleteResponder(resp *http.Response) (result FileOperationResult, err error) {
  483. err = autorest.Respond(
  484. resp,
  485. client.ByInspecting(),
  486. azure.WithErrorUnlessStatusCode(http.StatusOK),
  487. autorest.ByUnmarshallingJSON(&result),
  488. autorest.ByClosing())
  489. result.Response = autorest.Response{Response: resp}
  490. return
  491. }
  492. // GetACLStatus gets Access Control List (ACL) entries for the specified file or directory.
  493. //
  494. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  495. // Store path (starting with '/') of the file or directory for which to get the ACL. op is the constant value for the
  496. // operation. tooID is an optional switch to return friendly names in place of object ID for ACL entries. tooid=false
  497. // returns friendly names instead of the AAD Object ID. Default value is true, returning AAD object IDs.
  498. func (client Client) GetACLStatus(ctx context.Context, accountName string, pathParameter string, op string, tooID *bool) (result ACLStatusResult, err error) {
  499. req, err := client.GetACLStatusPreparer(ctx, accountName, pathParameter, op, tooID)
  500. if err != nil {
  501. err = autorest.NewErrorWithError(err, "filesystem.Client", "GetACLStatus", nil, "Failure preparing request")
  502. return
  503. }
  504. resp, err := client.GetACLStatusSender(req)
  505. if err != nil {
  506. result.Response = autorest.Response{Response: resp}
  507. err = autorest.NewErrorWithError(err, "filesystem.Client", "GetACLStatus", resp, "Failure sending request")
  508. return
  509. }
  510. result, err = client.GetACLStatusResponder(resp)
  511. if err != nil {
  512. err = autorest.NewErrorWithError(err, "filesystem.Client", "GetACLStatus", resp, "Failure responding to request")
  513. }
  514. return
  515. }
  516. // GetACLStatusPreparer prepares the GetACLStatus request.
  517. func (client Client) GetACLStatusPreparer(ctx context.Context, accountName string, pathParameter string, op string, tooID *bool) (*http.Request, error) {
  518. urlParameters := map[string]interface{}{
  519. "accountName": accountName,
  520. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  521. }
  522. pathParameters := map[string]interface{}{
  523. "path": autorest.Encode("path", pathParameter),
  524. }
  525. const APIVersion = "2016-11-01"
  526. queryParameters := map[string]interface{}{
  527. "api-version": APIVersion,
  528. "op": autorest.Encode("query", op),
  529. }
  530. if tooID != nil {
  531. queryParameters["tooId"] = autorest.Encode("query", *tooID)
  532. }
  533. preparer := autorest.CreatePreparer(
  534. autorest.AsGet(),
  535. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  536. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  537. autorest.WithQueryParameters(queryParameters))
  538. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  539. }
  540. // GetACLStatusSender sends the GetACLStatus request. The method will close the
  541. // http.Response Body if it receives an error.
  542. func (client Client) GetACLStatusSender(req *http.Request) (*http.Response, error) {
  543. return autorest.SendWithSender(client, req,
  544. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  545. }
  546. // GetACLStatusResponder handles the response to the GetACLStatus request. The method always
  547. // closes the http.Response Body.
  548. func (client Client) GetACLStatusResponder(resp *http.Response) (result ACLStatusResult, err error) {
  549. err = autorest.Respond(
  550. resp,
  551. client.ByInspecting(),
  552. azure.WithErrorUnlessStatusCode(http.StatusOK),
  553. autorest.ByUnmarshallingJSON(&result),
  554. autorest.ByClosing())
  555. result.Response = autorest.Response{Response: resp}
  556. return
  557. }
  558. // GetContentSummary gets the file content summary object specified by the file path.
  559. //
  560. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  561. // Store path (starting with '/') of the file for which to retrieve the summary. op is the constant value for the
  562. // operation.
  563. func (client Client) GetContentSummary(ctx context.Context, accountName string, pathParameter string, op string) (result ContentSummaryResult, err error) {
  564. req, err := client.GetContentSummaryPreparer(ctx, accountName, pathParameter, op)
  565. if err != nil {
  566. err = autorest.NewErrorWithError(err, "filesystem.Client", "GetContentSummary", nil, "Failure preparing request")
  567. return
  568. }
  569. resp, err := client.GetContentSummarySender(req)
  570. if err != nil {
  571. result.Response = autorest.Response{Response: resp}
  572. err = autorest.NewErrorWithError(err, "filesystem.Client", "GetContentSummary", resp, "Failure sending request")
  573. return
  574. }
  575. result, err = client.GetContentSummaryResponder(resp)
  576. if err != nil {
  577. err = autorest.NewErrorWithError(err, "filesystem.Client", "GetContentSummary", resp, "Failure responding to request")
  578. }
  579. return
  580. }
  581. // GetContentSummaryPreparer prepares the GetContentSummary request.
  582. func (client Client) GetContentSummaryPreparer(ctx context.Context, accountName string, pathParameter string, op string) (*http.Request, error) {
  583. urlParameters := map[string]interface{}{
  584. "accountName": accountName,
  585. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  586. }
  587. pathParameters := map[string]interface{}{
  588. "path": autorest.Encode("path", pathParameter),
  589. }
  590. const APIVersion = "2016-11-01"
  591. queryParameters := map[string]interface{}{
  592. "api-version": APIVersion,
  593. "op": autorest.Encode("query", op),
  594. }
  595. preparer := autorest.CreatePreparer(
  596. autorest.AsGet(),
  597. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  598. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  599. autorest.WithQueryParameters(queryParameters))
  600. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  601. }
  602. // GetContentSummarySender sends the GetContentSummary request. The method will close the
  603. // http.Response Body if it receives an error.
  604. func (client Client) GetContentSummarySender(req *http.Request) (*http.Response, error) {
  605. return autorest.SendWithSender(client, req,
  606. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  607. }
  608. // GetContentSummaryResponder handles the response to the GetContentSummary request. The method always
  609. // closes the http.Response Body.
  610. func (client Client) GetContentSummaryResponder(resp *http.Response) (result ContentSummaryResult, err error) {
  611. err = autorest.Respond(
  612. resp,
  613. client.ByInspecting(),
  614. azure.WithErrorUnlessStatusCode(http.StatusOK),
  615. autorest.ByUnmarshallingJSON(&result),
  616. autorest.ByClosing())
  617. result.Response = autorest.Response{Response: resp}
  618. return
  619. }
  620. // GetFileStatus get the file status object specified by the file path.
  621. //
  622. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  623. // Store path (starting with '/') of the file or directory for which to retrieve the status. op is the constant value
  624. // for the operation. tooID is an optional switch to return friendly names in place of owner and group. tooid=false
  625. // returns friendly names instead of the AAD Object ID. Default value is true, returning AAD object IDs.
  626. func (client Client) GetFileStatus(ctx context.Context, accountName string, pathParameter string, op string, tooID *bool) (result FileStatusResult, err error) {
  627. req, err := client.GetFileStatusPreparer(ctx, accountName, pathParameter, op, tooID)
  628. if err != nil {
  629. err = autorest.NewErrorWithError(err, "filesystem.Client", "GetFileStatus", nil, "Failure preparing request")
  630. return
  631. }
  632. resp, err := client.GetFileStatusSender(req)
  633. if err != nil {
  634. result.Response = autorest.Response{Response: resp}
  635. err = autorest.NewErrorWithError(err, "filesystem.Client", "GetFileStatus", resp, "Failure sending request")
  636. return
  637. }
  638. result, err = client.GetFileStatusResponder(resp)
  639. if err != nil {
  640. err = autorest.NewErrorWithError(err, "filesystem.Client", "GetFileStatus", resp, "Failure responding to request")
  641. }
  642. return
  643. }
  644. // GetFileStatusPreparer prepares the GetFileStatus request.
  645. func (client Client) GetFileStatusPreparer(ctx context.Context, accountName string, pathParameter string, op string, tooID *bool) (*http.Request, error) {
  646. urlParameters := map[string]interface{}{
  647. "accountName": accountName,
  648. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  649. }
  650. pathParameters := map[string]interface{}{
  651. "path": autorest.Encode("path", pathParameter),
  652. }
  653. const APIVersion = "2016-11-01"
  654. queryParameters := map[string]interface{}{
  655. "api-version": APIVersion,
  656. "op": autorest.Encode("query", op),
  657. }
  658. if tooID != nil {
  659. queryParameters["tooId"] = autorest.Encode("query", *tooID)
  660. }
  661. preparer := autorest.CreatePreparer(
  662. autorest.AsGet(),
  663. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  664. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  665. autorest.WithQueryParameters(queryParameters))
  666. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  667. }
  668. // GetFileStatusSender sends the GetFileStatus request. The method will close the
  669. // http.Response Body if it receives an error.
  670. func (client Client) GetFileStatusSender(req *http.Request) (*http.Response, error) {
  671. return autorest.SendWithSender(client, req,
  672. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  673. }
  674. // GetFileStatusResponder handles the response to the GetFileStatus request. The method always
  675. // closes the http.Response Body.
  676. func (client Client) GetFileStatusResponder(resp *http.Response) (result FileStatusResult, err error) {
  677. err = autorest.Respond(
  678. resp,
  679. client.ByInspecting(),
  680. azure.WithErrorUnlessStatusCode(http.StatusOK),
  681. autorest.ByUnmarshallingJSON(&result),
  682. autorest.ByClosing())
  683. result.Response = autorest.Response{Response: resp}
  684. return
  685. }
  686. // ListFileStatus get the list of file status objects specified by the file path, with optional pagination parameters
  687. //
  688. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  689. // Store path (starting with '/') of the directory to list. op is the constant value for the operation. listSize is
  690. // gets or sets the number of items to return. Optional. listAfter is gets or sets the item or lexographical index
  691. // after which to begin returning results. For example, a file list of 'a','b','d' and listAfter='b' will return 'd',
  692. // and a listAfter='c' will also return 'd'. Optional. listBefore is gets or sets the item or lexographical index
  693. // before which to begin returning results. For example, a file list of 'a','b','d' and listBefore='d' will return
  694. // 'a','b', and a listBefore='c' will also return 'a','b'. Optional. tooID is an optional switch to return friendly
  695. // names in place of owner and group. tooid=false returns friendly names instead of the AAD Object ID. Default value is
  696. // true, returning AAD object IDs.
  697. func (client Client) ListFileStatus(ctx context.Context, accountName string, pathParameter string, op string, listSize *int32, listAfter string, listBefore string, tooID *bool) (result FileStatusesResult, err error) {
  698. req, err := client.ListFileStatusPreparer(ctx, accountName, pathParameter, op, listSize, listAfter, listBefore, tooID)
  699. if err != nil {
  700. err = autorest.NewErrorWithError(err, "filesystem.Client", "ListFileStatus", nil, "Failure preparing request")
  701. return
  702. }
  703. resp, err := client.ListFileStatusSender(req)
  704. if err != nil {
  705. result.Response = autorest.Response{Response: resp}
  706. err = autorest.NewErrorWithError(err, "filesystem.Client", "ListFileStatus", resp, "Failure sending request")
  707. return
  708. }
  709. result, err = client.ListFileStatusResponder(resp)
  710. if err != nil {
  711. err = autorest.NewErrorWithError(err, "filesystem.Client", "ListFileStatus", resp, "Failure responding to request")
  712. }
  713. return
  714. }
  715. // ListFileStatusPreparer prepares the ListFileStatus request.
  716. func (client Client) ListFileStatusPreparer(ctx context.Context, accountName string, pathParameter string, op string, listSize *int32, listAfter string, listBefore string, tooID *bool) (*http.Request, error) {
  717. urlParameters := map[string]interface{}{
  718. "accountName": accountName,
  719. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  720. }
  721. pathParameters := map[string]interface{}{
  722. "path": autorest.Encode("path", pathParameter),
  723. }
  724. const APIVersion = "2016-11-01"
  725. queryParameters := map[string]interface{}{
  726. "api-version": APIVersion,
  727. "op": autorest.Encode("query", op),
  728. }
  729. if listSize != nil {
  730. queryParameters["listSize"] = autorest.Encode("query", *listSize)
  731. }
  732. if len(listAfter) > 0 {
  733. queryParameters["listAfter"] = autorest.Encode("query", listAfter)
  734. }
  735. if len(listBefore) > 0 {
  736. queryParameters["listBefore"] = autorest.Encode("query", listBefore)
  737. }
  738. if tooID != nil {
  739. queryParameters["tooId"] = autorest.Encode("query", *tooID)
  740. }
  741. preparer := autorest.CreatePreparer(
  742. autorest.AsGet(),
  743. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  744. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  745. autorest.WithQueryParameters(queryParameters))
  746. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  747. }
  748. // ListFileStatusSender sends the ListFileStatus request. The method will close the
  749. // http.Response Body if it receives an error.
  750. func (client Client) ListFileStatusSender(req *http.Request) (*http.Response, error) {
  751. return autorest.SendWithSender(client, req,
  752. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  753. }
  754. // ListFileStatusResponder handles the response to the ListFileStatus request. The method always
  755. // closes the http.Response Body.
  756. func (client Client) ListFileStatusResponder(resp *http.Response) (result FileStatusesResult, err error) {
  757. err = autorest.Respond(
  758. resp,
  759. client.ByInspecting(),
  760. azure.WithErrorUnlessStatusCode(http.StatusOK),
  761. autorest.ByUnmarshallingJSON(&result),
  762. autorest.ByClosing())
  763. result.Response = autorest.Response{Response: resp}
  764. return
  765. }
  766. // Mkdirs creates a directory.
  767. //
  768. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  769. // Store path (starting with '/') of the directory to create. op is the constant value for the operation. permission is
  770. // optional octal permission with which the directory should be created.
  771. func (client Client) Mkdirs(ctx context.Context, accountName string, pathParameter string, op string, permission *int32) (result FileOperationResult, err error) {
  772. req, err := client.MkdirsPreparer(ctx, accountName, pathParameter, op, permission)
  773. if err != nil {
  774. err = autorest.NewErrorWithError(err, "filesystem.Client", "Mkdirs", nil, "Failure preparing request")
  775. return
  776. }
  777. resp, err := client.MkdirsSender(req)
  778. if err != nil {
  779. result.Response = autorest.Response{Response: resp}
  780. err = autorest.NewErrorWithError(err, "filesystem.Client", "Mkdirs", resp, "Failure sending request")
  781. return
  782. }
  783. result, err = client.MkdirsResponder(resp)
  784. if err != nil {
  785. err = autorest.NewErrorWithError(err, "filesystem.Client", "Mkdirs", resp, "Failure responding to request")
  786. }
  787. return
  788. }
  789. // MkdirsPreparer prepares the Mkdirs request.
  790. func (client Client) MkdirsPreparer(ctx context.Context, accountName string, pathParameter string, op string, permission *int32) (*http.Request, error) {
  791. urlParameters := map[string]interface{}{
  792. "accountName": accountName,
  793. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  794. }
  795. pathParameters := map[string]interface{}{
  796. "path": autorest.Encode("path", pathParameter),
  797. }
  798. const APIVersion = "2016-11-01"
  799. queryParameters := map[string]interface{}{
  800. "api-version": APIVersion,
  801. "op": autorest.Encode("query", op),
  802. }
  803. if permission != nil {
  804. queryParameters["permission"] = autorest.Encode("query", *permission)
  805. }
  806. preparer := autorest.CreatePreparer(
  807. autorest.AsPut(),
  808. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  809. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  810. autorest.WithQueryParameters(queryParameters))
  811. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  812. }
  813. // MkdirsSender sends the Mkdirs request. The method will close the
  814. // http.Response Body if it receives an error.
  815. func (client Client) MkdirsSender(req *http.Request) (*http.Response, error) {
  816. return autorest.SendWithSender(client, req,
  817. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  818. }
  819. // MkdirsResponder handles the response to the Mkdirs request. The method always
  820. // closes the http.Response Body.
  821. func (client Client) MkdirsResponder(resp *http.Response) (result FileOperationResult, err error) {
  822. err = autorest.Respond(
  823. resp,
  824. client.ByInspecting(),
  825. azure.WithErrorUnlessStatusCode(http.StatusOK),
  826. autorest.ByUnmarshallingJSON(&result),
  827. autorest.ByClosing())
  828. result.Response = autorest.Response{Response: resp}
  829. return
  830. }
  831. // ModifyACLEntries modifies existing Access Control List (ACL) entries on a file or folder.
  832. //
  833. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  834. // Store path (starting with '/') of the file or directory with the ACL being modified. aclspec is the ACL
  835. // specification included in ACL modification operations in the format '[default:]user|group|other::r|-w|-x|-' op is
  836. // the constant value for the operation.
  837. func (client Client) ModifyACLEntries(ctx context.Context, accountName string, pathParameter string, aclspec string, op string) (result autorest.Response, err error) {
  838. req, err := client.ModifyACLEntriesPreparer(ctx, accountName, pathParameter, aclspec, op)
  839. if err != nil {
  840. err = autorest.NewErrorWithError(err, "filesystem.Client", "ModifyACLEntries", nil, "Failure preparing request")
  841. return
  842. }
  843. resp, err := client.ModifyACLEntriesSender(req)
  844. if err != nil {
  845. result.Response = resp
  846. err = autorest.NewErrorWithError(err, "filesystem.Client", "ModifyACLEntries", resp, "Failure sending request")
  847. return
  848. }
  849. result, err = client.ModifyACLEntriesResponder(resp)
  850. if err != nil {
  851. err = autorest.NewErrorWithError(err, "filesystem.Client", "ModifyACLEntries", resp, "Failure responding to request")
  852. }
  853. return
  854. }
  855. // ModifyACLEntriesPreparer prepares the ModifyACLEntries request.
  856. func (client Client) ModifyACLEntriesPreparer(ctx context.Context, accountName string, pathParameter string, aclspec string, op string) (*http.Request, error) {
  857. urlParameters := map[string]interface{}{
  858. "accountName": accountName,
  859. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  860. }
  861. pathParameters := map[string]interface{}{
  862. "path": autorest.Encode("path", pathParameter),
  863. }
  864. const APIVersion = "2016-11-01"
  865. queryParameters := map[string]interface{}{
  866. "aclspec": autorest.Encode("query", aclspec),
  867. "api-version": APIVersion,
  868. "op": autorest.Encode("query", op),
  869. }
  870. preparer := autorest.CreatePreparer(
  871. autorest.AsPut(),
  872. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  873. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  874. autorest.WithQueryParameters(queryParameters))
  875. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  876. }
  877. // ModifyACLEntriesSender sends the ModifyACLEntries request. The method will close the
  878. // http.Response Body if it receives an error.
  879. func (client Client) ModifyACLEntriesSender(req *http.Request) (*http.Response, error) {
  880. return autorest.SendWithSender(client, req,
  881. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  882. }
  883. // ModifyACLEntriesResponder handles the response to the ModifyACLEntries request. The method always
  884. // closes the http.Response Body.
  885. func (client Client) ModifyACLEntriesResponder(resp *http.Response) (result autorest.Response, err error) {
  886. err = autorest.Respond(
  887. resp,
  888. client.ByInspecting(),
  889. azure.WithErrorUnlessStatusCode(http.StatusOK),
  890. autorest.ByClosing())
  891. result.Response = resp
  892. return
  893. }
  894. // MsConcat concatenates the list of source files into the destination file, deleting all source files upon success.
  895. // This method accepts more source file paths than the Concat method. This method and the parameters it accepts are
  896. // subject to change for usability in an upcoming version.
  897. //
  898. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  899. // Store path (starting with '/') of the destination file resulting from the concatenation. streamContents is a list of
  900. // Data Lake Store paths (starting with '/') of the source files. Must be a comma-separated path list in the format:
  901. // sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv streamContents will be closed upon successful
  902. // return. Callers should ensure closure when receiving an error.op is the constant value for the operation.
  903. // deleteSourceDirectory is indicates that as an optimization instead of deleting each individual source stream, delete
  904. // the source stream folder if all streams are in the same folder instead. This results in a substantial performance
  905. // improvement when the only streams in the folder are part of the concatenation operation. WARNING: This includes the
  906. // deletion of any other files that are not source files. Only set this to true when source files are the only files in
  907. // the source directory.
  908. func (client Client) MsConcat(ctx context.Context, accountName string, pathParameter string, streamContents io.ReadCloser, op string, deleteSourceDirectory *bool) (result autorest.Response, err error) {
  909. req, err := client.MsConcatPreparer(ctx, accountName, pathParameter, streamContents, op, deleteSourceDirectory)
  910. if err != nil {
  911. err = autorest.NewErrorWithError(err, "filesystem.Client", "MsConcat", nil, "Failure preparing request")
  912. return
  913. }
  914. resp, err := client.MsConcatSender(req)
  915. if err != nil {
  916. result.Response = resp
  917. err = autorest.NewErrorWithError(err, "filesystem.Client", "MsConcat", resp, "Failure sending request")
  918. return
  919. }
  920. result, err = client.MsConcatResponder(resp)
  921. if err != nil {
  922. err = autorest.NewErrorWithError(err, "filesystem.Client", "MsConcat", resp, "Failure responding to request")
  923. }
  924. return
  925. }
  926. // MsConcatPreparer prepares the MsConcat request.
  927. func (client Client) MsConcatPreparer(ctx context.Context, accountName string, pathParameter string, streamContents io.ReadCloser, op string, deleteSourceDirectory *bool) (*http.Request, error) {
  928. urlParameters := map[string]interface{}{
  929. "accountName": accountName,
  930. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  931. }
  932. pathParameters := map[string]interface{}{
  933. "path": autorest.Encode("path", pathParameter),
  934. }
  935. const APIVersion = "2016-11-01"
  936. queryParameters := map[string]interface{}{
  937. "api-version": APIVersion,
  938. "op": autorest.Encode("query", op),
  939. }
  940. if deleteSourceDirectory != nil {
  941. queryParameters["deleteSourceDirectory"] = autorest.Encode("query", *deleteSourceDirectory)
  942. }
  943. preparer := autorest.CreatePreparer(
  944. autorest.AsPost(),
  945. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  946. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  947. autorest.WithFile(streamContents),
  948. autorest.WithQueryParameters(queryParameters))
  949. return preparer.Prepare((&http.Request{}).WithContext(ctx))
  950. }
  951. // MsConcatSender sends the MsConcat request. The method will close the
  952. // http.Response Body if it receives an error.
  953. func (client Client) MsConcatSender(req *http.Request) (*http.Response, error) {
  954. return autorest.SendWithSender(client, req,
  955. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  956. }
  957. // MsConcatResponder handles the response to the MsConcat request. The method always
  958. // closes the http.Response Body.
  959. func (client Client) MsConcatResponder(resp *http.Response) (result autorest.Response, err error) {
  960. err = autorest.Respond(
  961. resp,
  962. client.ByInspecting(),
  963. azure.WithErrorUnlessStatusCode(http.StatusOK),
  964. autorest.B