Exemplo n.º 1
0
        internal CreateRepositoryResponse CreateRepository(CreateRepositoryRequest request)
        {
            var marshaller   = new CreateRepositoryRequestMarshaller();
            var unmarshaller = CreateRepositoryResponseUnmarshaller.Instance;

            return(Invoke <CreateRepositoryRequest, CreateRepositoryResponse>(request, marshaller, unmarshaller));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateRepository operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateRepository operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <CreateRepositoryResponse> CreateRepositoryAsync(CreateRepositoryRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateRepositoryRequestMarshaller();
            var unmarshaller = CreateRepositoryResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateRepositoryRequest, CreateRepositoryResponse>(request, marshaller,
                                                                                   unmarshaller, cancellationToken));
        }
        public async Task<Repository> CreateECRRepository(OrchestratorSession session, string repositoryName)
        {
            var ecrClient = _awsClientFactory.GetAWSClient<IAmazonECR>(session.AWSCredentials, session.AWSRegion);

            var request = new CreateRepositoryRequest
            {
                RepositoryName = repositoryName
            };

            var response = await ecrClient.CreateRepositoryAsync(request);

            return response.Repository;
        }
        public async Task <Repository> CreateECRRepository(string repositoryName)
        {
            var ecrClient = _awsClientFactory.GetAWSClient <IAmazonECR>();

            var request = new CreateRepositoryRequest
            {
                RepositoryName = repositoryName
            };

            var response = await ecrClient.CreateRepositoryAsync(request);

            return(response.Repository);
        }
		public CreateRepositoryRequestTests()
		{
			var request = new CreateRepositoryRequest("my-new-repos")
			{
				Repository = new AzureRepository
				{
					Settings = new Dictionary<string, object>
					{
						{"bucket", "ad4423423fasf"}
					}
				}
			};
			var response = this._client.CreateRepository(request);
			this._status = response.ConnectionStatus;
		}
Exemplo n.º 6
0
        public CreateRepositoryRequestTests()
        {
            var request = new CreateRepositoryRequest("my-new-repos")
            {
                Repository = new AzureRepository
                {
                    Settings = new Dictionary <string, object>
                    {
                        { "bucket", "ad4423423fasf" }
                    }
                }
            };
            var response = this._client.CreateRepository(request);

            this._status = response.ConnectionStatus;
        }
		public CreateRepositoryRequestTests()
		{
			var request = new CreateRepositoryRequest("repos")
			{
				Repository = new AzureRepository
				{
					Settings = new Dictionary<string, object>
					{
						{ "bucket", "my-bucket" },
						{ "compress", true },
						{ "concurrent_stream", 4 }
					}
				}
			};
			var response = this._client.CreateRepository(request);
			this._status = response.ConnectionStatus;
		}
Exemplo n.º 8
0
        public CreateRepositoryRequestTests()
        {
            var request = new CreateRepositoryRequest("repos")
            {
                Repository = new AzureRepository
                {
                    Settings = new Dictionary <string, object>
                    {
                        { "bucket", "my-bucket" },
                        { "compress", true },
                        { "concurrent_stream", 4 }
                    }
                }
            };
            var response = this._client.CreateRepository(request);

            this._status = response.ConnectionStatus;
        }
        protected override void ProcessRecord()
        {
            //create repository
            var request = new CreateRepositoryRequest(this.Name)
            {
                Repository = new FileSystemRepository(this.GetSettings())
            };

            var response = this.Client.CreateRepository(request);

            CheckResponse(response);

            //get repository
            var response1 = this.Client.GetRepository(new GetRepositoryRequest(this.Name));

            CheckResponse(response1);

            foreach (var repo in response1.Repositories.Keys)
            {
                WriteObject(response1.GetRepository(repo));
            }
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            CreateRepositoryRequest request;

            try
            {
                request = new CreateRepositoryRequest
                {
                    CreateRepositoryDetails = CreateRepositoryDetails,
                    OpcRetryToken           = OpcRetryToken,
                    OpcRequestId            = OpcRequestId
                };

                response = client.CreateRepository(request).GetAwaiter().GetResult();
                WriteOutput(response, response.Repository);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Backup existing indexes
        /// </summary>
        /// <param name="backUpName">The snapshot and backup repository name</param>
        /// <param name="path">Check elasticsearch.yml for setting this correctly. Path is declared in path.repo["backuppath"] and is located in path.data folder.</param>
        public static void BackUp(string backUpName, string path)
        {
            var esClient = Manager.EsClient;

            var rreq = new CreateRepositoryRequest(backUpName)
            {
                Repository = new FileSystemRepository(new FileSystemRepositorySettings(path))
            };

            var rr = esClient.Snapshot.CreateRepository(rreq);

            if (rr.ServerError != null)
            {
                throw new Exception(rr.ServerError.Error.ToString());
            }
            var sreq = new SnapshotRequest(backUpName, backUpName);
            var sr   = esClient.Snapshot.Snapshot(sreq);

            if (sr.ServerError != null)
            {
                throw new Exception(sr.ServerError.Error.ToString());
            }
        }
Exemplo n.º 12
0
 /// <summary>
 ///  通过参数创建镜像仓库。
 /// 仓库名称可以分解为多个路径名,每个名称必须至少包含一个小写字母数字,考虑URL规范。
 /// 支持包含段划线或者下划线进行分割,但不允许点&#39;.&#39;,多个路径名之间通过(&quot;/&quot;)连接,总长度不超过256个字符,当前只支持二级目录。
 ///
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public async Task <CreateRepositoryResponse> CreateRepository(CreateRepositoryRequest request)
 {
     return(await new CreateRepositoryExecutor().Client(this).Execute <CreateRepositoryResponse, CreateRepositoryResult, CreateRepositoryRequest>(request).ConfigureAwait(false));
 }
Exemplo n.º 13
0
 /// <summary>
 ///  通过参数创建镜像仓库。
 /// 仓库名称可以分解为多个路径名,每个名称必须至少包含一个小写字母数字,考虑URL规范。
 /// 支持包含段划线或者下划线进行分割,但不允许点&#39;.&#39;,多个路径名之间通过(&quot;/&quot;)连接,总长度不超过256个字符,当前只支持二级目录。
 ///
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public CreateRepositoryResponse CreateRepository(CreateRepositoryRequest request)
 {
     return(new CreateRepositoryExecutor().Client(this).Execute <CreateRepositoryResponse, CreateRepositoryResult, CreateRepositoryRequest>(request));
 }