Container for the parameters to the CreateBGPPeer operation. Creates a new BGP peer on a specified virtual interface. The BGP peer cannot be in the same address family (IPv4/IPv6) of an existing BGP peer on the virtual interface.

You must create a BGP peer for the corresponding address family in order to access AWS resources that also use that address family.

When creating a IPv6 BGP peer, the Amazon address and customer address fields must be left blank. IPv6 addresses are automatically assigned from Amazon's pool of IPv6 addresses; you cannot specify custom IPv6 addresses.

For a public virtual interface, the Autonomous System Number (ASN) must be private or already whitelisted for the virtual interface.

Inheritance: AmazonDirectConnectRequest
 private Amazon.DirectConnect.Model.CreateBGPPeerResponse CallAWSServiceOperation(IAmazonDirectConnect client, Amazon.DirectConnect.Model.CreateBGPPeerRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Direct Connect", "CreateBGPPeer");
     try
     {
         #if DESKTOP
         return(client.CreateBGPPeer(request));
         #elif CORECLR
         return(client.CreateBGPPeerAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.DirectConnect.Model.CreateBGPPeerRequest();


            // populate NewBGPPeer
            var requestNewBGPPeerIsNull = true;

            request.NewBGPPeer = new Amazon.DirectConnect.Model.NewBGPPeer();
            Amazon.DirectConnect.AddressFamily requestNewBGPPeer_newBGPPeer_AddressFamily = null;
            if (cmdletContext.NewBGPPeer_AddressFamily != null)
            {
                requestNewBGPPeer_newBGPPeer_AddressFamily = cmdletContext.NewBGPPeer_AddressFamily;
            }
            if (requestNewBGPPeer_newBGPPeer_AddressFamily != null)
            {
                request.NewBGPPeer.AddressFamily = requestNewBGPPeer_newBGPPeer_AddressFamily;
                requestNewBGPPeerIsNull          = false;
            }
            System.String requestNewBGPPeer_newBGPPeer_AmazonAddress = null;
            if (cmdletContext.NewBGPPeer_AmazonAddress != null)
            {
                requestNewBGPPeer_newBGPPeer_AmazonAddress = cmdletContext.NewBGPPeer_AmazonAddress;
            }
            if (requestNewBGPPeer_newBGPPeer_AmazonAddress != null)
            {
                request.NewBGPPeer.AmazonAddress = requestNewBGPPeer_newBGPPeer_AmazonAddress;
                requestNewBGPPeerIsNull          = false;
            }
            System.Int32?requestNewBGPPeer_newBGPPeer_Asn = null;
            if (cmdletContext.NewBGPPeer_Asn != null)
            {
                requestNewBGPPeer_newBGPPeer_Asn = cmdletContext.NewBGPPeer_Asn.Value;
            }
            if (requestNewBGPPeer_newBGPPeer_Asn != null)
            {
                request.NewBGPPeer.Asn  = requestNewBGPPeer_newBGPPeer_Asn.Value;
                requestNewBGPPeerIsNull = false;
            }
            System.String requestNewBGPPeer_newBGPPeer_AuthKey = null;
            if (cmdletContext.NewBGPPeer_AuthKey != null)
            {
                requestNewBGPPeer_newBGPPeer_AuthKey = cmdletContext.NewBGPPeer_AuthKey;
            }
            if (requestNewBGPPeer_newBGPPeer_AuthKey != null)
            {
                request.NewBGPPeer.AuthKey = requestNewBGPPeer_newBGPPeer_AuthKey;
                requestNewBGPPeerIsNull    = false;
            }
            System.String requestNewBGPPeer_newBGPPeer_CustomerAddress = null;
            if (cmdletContext.NewBGPPeer_CustomerAddress != null)
            {
                requestNewBGPPeer_newBGPPeer_CustomerAddress = cmdletContext.NewBGPPeer_CustomerAddress;
            }
            if (requestNewBGPPeer_newBGPPeer_CustomerAddress != null)
            {
                request.NewBGPPeer.CustomerAddress = requestNewBGPPeer_newBGPPeer_CustomerAddress;
                requestNewBGPPeerIsNull            = false;
            }
            // determine if request.NewBGPPeer should be set to null
            if (requestNewBGPPeerIsNull)
            {
                request.NewBGPPeer = null;
            }
            if (cmdletContext.VirtualInterfaceId != null)
            {
                request.VirtualInterfaceId = cmdletContext.VirtualInterfaceId;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new BGP peer on a specified virtual interface. The BGP peer cannot be in
        /// the same address family (IPv4/IPv6) of an existing BGP peer on the virtual interface.
        /// 
        ///  
        /// <para>
        /// You must create a BGP peer for the corresponding address family in order to access
        /// AWS resources that also use that address family.
        /// </para>
        ///  
        /// <para>
        /// When creating a IPv6 BGP peer, the Amazon address and customer address fields must
        /// be left blank. IPv6 addresses are automatically assigned from Amazon's pool of IPv6
        /// addresses; you cannot specify custom IPv6 addresses.
        /// </para>
        ///  
        /// <para>
        /// For a public virtual interface, the Autonomous System Number (ASN) must be private
        /// or already whitelisted for the virtual interface.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateBGPPeer service method.</param>
        /// 
        /// <returns>The response from the CreateBGPPeer service method, as returned by DirectConnect.</returns>
        /// <exception cref="Amazon.DirectConnect.Model.DirectConnectClientException">
        /// The API was called with invalid parameters. The error message will contain additional
        /// details about the cause.
        /// </exception>
        /// <exception cref="Amazon.DirectConnect.Model.DirectConnectServerException">
        /// A server-side error occurred during the API call. The error message will contain additional
        /// details about the cause.
        /// </exception>
        public CreateBGPPeerResponse CreateBGPPeer(CreateBGPPeerRequest request)
        {
            var marshaller = new CreateBGPPeerRequestMarshaller();
            var unmarshaller = CreateBGPPeerResponseUnmarshaller.Instance;

            return Invoke<CreateBGPPeerRequest,CreateBGPPeerResponse>(request, marshaller, unmarshaller);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateBGPPeer operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateBGPPeer 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<CreateBGPPeerResponse> CreateBGPPeerAsync(CreateBGPPeerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateBGPPeerRequestMarshaller();
            var unmarshaller = CreateBGPPeerResponseUnmarshaller.Instance;

            return InvokeAsync<CreateBGPPeerRequest,CreateBGPPeerResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateBGPPeer operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateBGPPeer operation on AmazonDirectConnectClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateBGPPeer
        ///         operation.</returns>
        public IAsyncResult BeginCreateBGPPeer(CreateBGPPeerRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateBGPPeerRequestMarshaller();
            var unmarshaller = CreateBGPPeerResponseUnmarshaller.Instance;

            return BeginInvoke<CreateBGPPeerRequest>(request, marshaller, unmarshaller,
                callback, state);
        }