private void updatePeerAsn(MockContext context, int asn)
        {
            string[] phone       = { "9999999" };
            string[] email       = { $"noc{asn}@contoso.com" };
            var      contactInfo = new ContactInfo(email, phone);
            var      peerInfo    = new PeerAsn(peerAsnProperty: asn, peerContactInfo: contactInfo, peerName: $"Contoso{asn}", validationState: "Approved");

            this.client = context.GetServiceClient <PeeringManagementClient>();
            try
            {
                var result  = this.client.PeerAsns.CreateOrUpdate(peerInfo.PeerName, peerInfo);
                var peerAsn = this.client.PeerAsns.Get(peerInfo.PeerName);
                Assert.NotNull(peerAsn);
            }
            catch (Exception exception)
            {
                var peerAsn = this.client.PeerAsns.ListBySubscription();
                Assert.NotNull(peerAsn);
                Assert.NotNull(exception);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the PeerAsn class.
 /// </summary>
 /// <param name="name">The name of the resource.</param>
 /// <param name="id">The ID of the resource.</param>
 /// <param name="type">The type of the resource.</param>
 /// <param name="peerAsnProperty">The Autonomous System Number (ASN) of
 /// the peer.</param>
 /// <param name="peerContactInfo">The contact information of the
 /// peer.</param>
 /// <param name="peerName">The name of the peer.</param>
 /// <param name="validationState">The validation state of the ASN
 /// associated with the peer. Possible values include: 'None',
 /// 'Pending', 'Approved', 'Failed'</param>
 public PeerAsn(string name = default(string), string id = default(string), string type = default(string), int?peerAsnProperty = default(int?), ContactInfo peerContactInfo = default(ContactInfo), string peerName = default(string), string validationState = default(string))
     : base(name, id, type)
 {
     PeerAsnProperty = peerAsnProperty;
     PeerContactInfo = peerContactInfo;
     PeerName        = peerName;
     ValidationState = validationState;
     CustomInit();
 }