Apigee Edge का दस्तावेज़ देखा जा रहा है.
Go to the
Apigee X documentation. info
InvalidMessageWeight
गड़बड़ी का कोड
policies.ratelimit.InvalidMessageWeight
गड़बड़ी के जवाब का मुख्य हिस्सा
{
"fault": {
"faultstring": "Invalid message weight value [invalid_value]",
"detail": {
"errorcode": "policies.ratelimit.InvalidMessageWeight"
}
}
}
गड़बड़ी के मैसेज का उदाहरण
{
"fault": {
"faultstring": "Invalid message weight value 1.5",
"detail": {
"errorcode": "policies.ratelimit.InvalidMessageWeight"
}
}
}
वजह
यह गड़बड़ी तब होती है, जब फ़्लो वैरिएबल के ज़रिए तय की गई <MessageWeight> एलिमेंट की वैल्यू अमान्य होती है. जैसे, कोई नॉन-इंटीजर वैल्यू.
उदाहरण के लिए, यह गड़बड़ी तब होगी, जब <MessageWeight> एलिमेंट के लिए तय की गई फ़्लो वैरिएबल की वैल्यू 1.5 (नॉन-इंटीजर वैल्यू) होगी.
संक्रमण की जांच
कोटा नीति में,
<MessageWeight>एलिमेंट के लिए इस्तेमाल की गई अमान्य वैल्यू की पहचान करें. यह जानकारी, गड़बड़ी के जवाब केfaultstringएलिमेंट में मिल सकती है. उदाहरण के लिए, यहां दी गई गड़बड़ी में,<MessageWeight>एलिमेंट के लिए इस्तेमाल की गई अमान्य वैल्यू1.5है:"faultstring": "Invalid message weight value 1.5"उस एपीआई प्रॉक्सी में मौजूद सभी कोटा नीतियों की जांच करें जहां गड़बड़ी हुई है. एक या उससे ज़्यादा कोटा नीतियां हो सकती हैं जिनमें
<MessageWeight>एलिमेंट तय किया गया हो.उदाहरण के लिए, यहां दी गई नीति में, फ़्लो वैरिएबल
message_weightके ज़रिए<MessageWeight>तय किया गया है:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Quota async="false" continueOnError="false" enabled="true" name="Quota_with_weight" type="calendar"> <DisplayName>Quota_with_weight</DisplayName> <Properties/> <Allow count="3"/> <Interval>1</Interval> <TimeUnit>minute</TimeUnit> <StartTime>2017-7-16 12:00:00</StartTime> <MessageWeight ref="message_weight"/> </Quota>पहचान की गई कोटा नीति या नीतियों में,
<MessageWeight>के लिए इस्तेमाल किए गए वैरिएबल की वैल्यू तय करें. फ़्लो वैरिएबल की वैल्यू, एचटीटीपी हेडर, क्वेरी पैरामीटर, एक्सएमएल या JSON अनुरोध पेलोड से निकाली जा सकती है. इसके अलावा, इसे किसी दूसरी नीति में भी तय किया जा सकता है:- एपीआई प्रॉक्सी बंडल में वह कोड ढूंढें जहां वैरिएबल को पहली बार तय किया गया था.
- जब आपको उस नीति के बारे में पता चल जाए जिसमें वैरिएबल को पहली बार तय और पॉप्युलेट किया गया है, तो देखें कि वैरिएबल के लिए वैल्यू कैसे सेट की गई है.
- अगर फ़्लो वैरिएबल की वैल्यू, ऊपर दिए गए पहले चरण में तय की गई वैल्यू से मेल खाती है, तो यह गड़बड़ी की वजह है.
उदाहरण के लिए, मान लें कि कोटा नीति से पहले इस्तेमाल की गई JavaScript नीति, अनुरोध के टाइप के आधार पर वैरिएबल
message_weightसेट करती है. जैसा कि यहां दिखाया गया है:var verb = context.getVariable("request.verb"); context.setVariable("message_weight", "1.5"); if (verb == 'POST') { context.setVariable("message_weight", "2"); }ध्यान दें कि वैरिएबल
message_weightकी वैल्यू1.5है, जो अमान्य (नॉन-इंटीजर) वैल्यू है.
रिज़ॉल्यूशन
पक्का करें कि फ़्लो वैरिएबल से तय की गई MessageWeight की वैल्यू, मान्य वैल्यू (इंटीजर वैल्यू) हो.
ऊपर दिखाए गए उदाहरण को ठीक करने के लिए, JavaScript में वैरिएबल message_weight की वैल्यू को इंटीजर में बदला जा सकता है.
var verb = context.getVariable("request.verb");
context.setVariable("message_weight", "1");
if (verb == 'POST') {
context.setVariable("message_weight", "2");
}
FailedToResolveQuotaIntervalReference
गड़बड़ी का कोड
policies.ratelimit.FailedToResolveQuotaIntervalReference
गड़बड़ी के जवाब का मुख्य हिस्सा
{
"fault": {
"faultstring": "Failed to resolve quota interval reference [reference] in quota policy {1}",
"detail": {
"errorcode": "policies.ratelimit.FailedToResolveQuotaIntervalReference"
}
}
}
गड़बड़ी के मैसेज का उदाहरण
{
"fault": {
"faultstring": "Failed to resolve quota interval reference api.product.developer.quota.interval in quota policy {1}",
"detail": {
"errorcode": "policies.ratelimit.FailedToResolveQuotaIntervalReference"
}
}
}
वजह
यह गड़बड़ी तब होती है, जब कोटा नीति में <Interval> एलिमेंट तय नहीं किया जाता. यह एलिमेंट ज़रूरी है और इसका इस्तेमाल, कोटा पर लागू होने वाली समयावधि तय करने के लिए किया जाता है. समयावधि, मिनट, घंटे, दिन, हफ़्ते या महीने में हो सकती है. इसे <TimeUnit> एलिमेंट के साथ तय किया जाता है.
संक्रमण की जांच
उस एपीआई प्रॉक्सी में मौजूद सभी कोटा नीतियों की जांच करें जहां गड़बड़ी हुई है. अगर कोई ऐसी कोटा नीति है जिसमें ज़रूरी एलिमेंट
<Interval>तय नहीं किया गया है, तो यह गड़बड़ी की वजह है.उदाहरण के लिए, यहां दी गई कोटा नीति में ज़रूरी एलिमेंट
<Interval>नहीं है:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Quota async="false" continueOnError="false" enabled="true" name="CheckQuota" type="calendar"> <DisplayName>CheckQuota</DisplayName> <Properties/> <Allow count="3"/> <TimeUnit ref="verifyapikey.verify-api-key.apiproduct.developer.quota.timeunit">hour</TimeUnit> <StartTime>2017-7-16 12:00:00</StartTime> </Quota>ऊपर दी गई कोटा नीति में ज़रूरी एलिमेंट
<TimeUnit>तय नहीं किया गया है. इसलिए, आपको यह गड़बड़ी कोड मिलेगा:policies.ratelimit.FailedToResolveQuotaIntervalReference
रिज़ॉल्यूशन
पक्का करें कि किसी एपीआई प्रॉक्सी के लिए सभी कोटा नीतियों में, ज़रूरी एलिमेंट <Interval> सही तरीके से तय किया गया हो.
ऊपर दिखाए गए उदाहरण को ठीक करने के लिए, नीति में बदलाव करके <Interval> एलिमेंट को शामिल किया जा सकता है.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Quota async="false" continueOnError="false" enabled="true" name="CheckQuota" type="calendar"> <DisplayName>CheckQuota</DisplayName> <Properties/> <Allow count="3"/> <TimeUnit ref="verifyapikey.verify-api-key.apiproduct.developer.quota.timeunit">hour</TimeUnit> <Interval ref="verifyapikey.verify-api-key.apiproduct.developer.quota.interval">1</Interval> <StartTime>2017-7-16 12:00:00</StartTime> </Quota>
FailedToResolveQuotaIntervalTimeUnitReference
गड़बड़ी का कोड
policies.ratelimit.FailedToResolveQuotaIntervalTimeUnitReference
गड़बड़ी के जवाब का मुख्य हिस्सा
{
"fault": {
"faultstring": "Failed to resolve quota time unit reference [reference] in quota policy {1}",
"detail": {
"errorcode": "policies.ratelimit.FailedToResolveQuotaIntervalTimeUnitReference"
}
}
}
गड़बड़ी के मैसेज का उदाहरण
{
"fault": {
"faultstring": "Failed to resolve quota time unit reference apiproduct.developer.quota.timeunity in quota policy {1}",
"detail": {
"errorcode": "policies.ratelimit.FailedToResolveQuotaIntervalTimeUnitReference"
}
}
}
वजह
यह गड़बड़ी तब होती है, जब कोटा नीति में <TimeUnit> एलिमेंट तय नहीं किया जाता. यह एलिमेंट ज़रूरी है और इसका इस्तेमाल, कोटा पर लागू होने वाली समय की यूनिट तय करने के लिए किया जाता है. समयावधि, मिनट, घंटे, दिन, हफ़्ते या महीने में हो सकती है.
संक्रमण की जांच
उस एपीआई प्रॉक्सी में मौजूद सभी कोटा नीतियों की जांच करें जहां गड़बड़ी हुई है. अगर कोई ऐसी कोटा नीति है जिसमें ज़रूरी एलिमेंट
<TimeUnit>तय नहीं किया गया है, तो यह गड़बड़ी की वजह है.उदाहरण के लिए, यहां दी गई कोटा नीति में ज़रूरी एलिमेंट
<TimeUnit>नहीं है:<Quota async="false" continueOnError="false" enabled="true" name="CheckQuota" type="calendar"> <DisplayName>CheckQuota</DisplayName> <Properties/> <Allow count="3"/> <Interval ref="verifyapikey.verify-api-key.apiproduct.developer.quota.interval">1</Interval> <StartTime>2017-7-16 12:00:00</StartTime> </Quota>ऊपर दी गई कोटा नीति में ज़रूरी एलिमेंट
<TimeUnit>तय नहीं किया गया है. इसलिए, आपको यह गड़बड़ी कोड मिलेगा:policies.ratelimit.FailedToResolveQuotaIntervalTimeUnitReference
रिज़ॉल्यूशन
पक्का करें कि किसी एपीआई प्रॉक्सी के लिए सभी कोटा नीतियों में, ज़रूरी एलिमेंट <TimeUnit> तय किया गया हो.
ऊपर दिखाए गए उदाहरण को ठीक करने के लिए, नीति में बदलाव करके <TimeUnit> एलिमेंट को शामिल किया जा सकता है.
<Quota async="false" continueOnError="false" enabled="true" name="CheckQuota" type="calendar"> <DisplayName>CheckQuota</DisplayName> <Properties/> <Allow count="3"/> <TimeUnit ref="verifyapikey.verify-api-key.apiproduct.developer.quota.timeunit">hour</TimeUnit> <Interval ref="verifyapikey.verify-api-key.apiproduct.developer.quota.interval">1</Interval> <StartTime>2017-7-16 12:00:00</StartTime> </Quota>