content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
#!/usr/bin/env python """ https://leetcode.com/problems/plus-one/description/ Created on 2018-11-14 @author: 'Jiezhi.G@gmail.com' Reference: """ class Solution: def plusOne(self, digits): """ :type digits: List[int] :rtype: List[int] """ l = len(digits) - 1 while l >= 0 and digits[l] == 9: digits[l] = 0 l -= 1 if l < 0: digits.insert(0, 1) else: digits[l] += 1 return digits def test(): assert Solution().plusOne([0]) == [1] assert Solution().plusOne([1, 2, 3, 4]) == [1, 2, 3, 5] assert Solution().plusOne([1, 2, 3, 9]) == [1, 2, 4, 0] assert Solution().plusOne([9, 9, 9]) == [1, 0, 0, 0]
""" https://leetcode.com/problems/plus-one/description/ Created on 2018-11-14 @author: 'Jiezhi.G@gmail.com' Reference: """ class Solution: def plus_one(self, digits): """ :type digits: List[int] :rtype: List[int] """ l = len(digits) - 1 while l >= 0 and digits[l] == 9: digits[l] = 0 l -= 1 if l < 0: digits.insert(0, 1) else: digits[l] += 1 return digits def test(): assert solution().plusOne([0]) == [1] assert solution().plusOne([1, 2, 3, 4]) == [1, 2, 3, 5] assert solution().plusOne([1, 2, 3, 9]) == [1, 2, 4, 0] assert solution().plusOne([9, 9, 9]) == [1, 0, 0, 0]
key = {'f':'l', 'd': 'l','j':'r', 'k':'r'} words = {} for _ in range(int(input())): n = int(input()) for _ in range(n): s = input() if words.get(s): words[s] += 1 else : words[s] = 1 # print(words) final_ans = 0 for i in words: c_word_ans = 0.2 pre = key[i[0]] for j in i[1::]: if(key[j] == pre):c_word_ans += 0.4 else: c_word_ans += 0.2 pre = key[j] final_ans += c_word_ans + ((words[i] - 1) * c_word_ans / 2) print(int(final_ans * 10))
key = {'f': 'l', 'd': 'l', 'j': 'r', 'k': 'r'} words = {} for _ in range(int(input())): n = int(input()) for _ in range(n): s = input() if words.get(s): words[s] += 1 else: words[s] = 1 final_ans = 0 for i in words: c_word_ans = 0.2 pre = key[i[0]] for j in i[1:]: if key[j] == pre: c_word_ans += 0.4 else: c_word_ans += 0.2 pre = key[j] final_ans += c_word_ans + (words[i] - 1) * c_word_ans / 2 print(int(final_ans * 10))
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. class PotentialEdgeColumnPair: def __init__(self, source, destination, score): self._source = source self._destination = destination self._score = score def source(self): return self._source def destination(self): return self._destination def score(self): return self._score
class Potentialedgecolumnpair: def __init__(self, source, destination, score): self._source = source self._destination = destination self._score = score def source(self): return self._source def destination(self): return self._destination def score(self): return self._score
class ModelOutput: # Class that defines model output structure def __init__(self, arg_type, arg_size, is_spacial): self.arg_type = arg_type self.arg_size = arg_size self.is_spacial = is_spacial
class Modeloutput: def __init__(self, arg_type, arg_size, is_spacial): self.arg_type = arg_type self.arg_size = arg_size self.is_spacial = is_spacial
class DateGetter: '''Parse a date using the datetime format string defined in the current jxn's config. ''' def _get_date(self, label_text): fmt = self.get_config_value('datetime_format') text = self.get_field_text(label_text) if text is not None: dt = datetime.strptime(text, fmt) dt = self.cfg.datetime_add_tz(dt) return dt class BillsFields(FieldAggregator, DateGetter): text_fields = ( 'law_number', 'type', 'status', 'name', 'version', 'sponsor_office') def get_intro_data(self): return self._get_date('intro_date') def get_file_created(self): return self._get_date('file_created') def gen_sources(self): grouped = collections.defaultdict(set) for note, url in self.chainmap['sources'].items(): grouped[url].add(note) for url, notes in grouped.items(): yield dict(url=url, note=', '.join(sorted(notes))) class BillsSearchForm(FirefoxForm): '''Model the legistar "Legislation" search form. ''' sources_note = 'bill search table' def is_advanced_search(self): switch_el_id = self.cfg.BILL_SEARCH_SWITCH_EL_ID switch_el = self.firefox.find_element_by_id(switch_el_id) switch_el_text = switch_el.text.lower() if self.cfg.BILL_SEARCH_SWITCH_SIMPLE in switch_el_text: return True return False def switch_to_advanced_search(self): switch_el_id = self.cfg.BILL_SEARCH_SWITCH_EL_ID switch_el = self.firefox.find_element_by_id(switch_el_id) switch_el.click() def fill_out_form(self): if not self.is_advanced_search(): self.switch_to_advanced_search() max_results_id = "ctl00_ContentPlaceHolder1_lstMax" self.set_dropdown(max_results_id, 'All') years_id = "ctl00_ContentPlaceHolder1_lstYearsAdvanced" self.set_dropdown(years_id, 'This Year') class BillsDetailView(DetailView, BillsFields): sources_note = 'bill detail' text_fields = ('version', 'name') def get_file_number(self): return self.get_field_text('file_number') def get_title(self): title = self.get_field_text('title') # If no title, re-use type (i.e., "Resolution") if not title: title = self.get_field_text('type') return title def get_agenda_date(self): return self._get_date('agenda') def get_enactment_date(self): return self._get_date('enactment_date') def get_final_action(self): return self._get_date('final_action') def gen_sponsors(self): sponsors = self.get_field_text('sponsors') for name in re.split(r',\s+', sponsors): name = name.strip() if name: yield dict(name=name) def gen_documents(self): for el in self.xpath('attachments', './/a'): data = ElementAccessor(el) url = data.get_url() media_type = 'application/pdf' yield dict( name=data.get_text(), links=[dict( url=data.get_url(), media_type=media_type)]) def gen_action(self): yield from self.Form(self) def gen_identifiers(self): '''Yield out the internal legistar bill id and guid found in the detail page url. ''' detail_url = self.chainmap['sources'][self.sources_note] url = urlparse(detail_url) for idtype, ident in parse_qsl(url.query): if idtype == 'options' or ident == 'Advanced': continue yield dict( scheme="legistar_" + idtype.lower(), identifier=ident) def get_legislative_session(self): dates = [] labels = ('agenda', 'created') for label in labels: labeltext = self.get_label_text(label, skipitem=False) if labeltext not in self.field_data.keys(): continue if not self.field_data[labeltext]: continue data = self.field_data[labeltext][0] fmt = self.get_config_value('datetime_format') text = data.get_text() if text is not None: dt = datetime.strptime(text, fmt) dt = self.cfg.datetime_add_tz(dt) dates.append(dt) _, actions = self.gen_action() for action in actions: dates.append(action['date']) if dates: return str(max(dates).year) self.critical('Need session date.') class BillsDetailTableRow(TableRow, FieldAggregator, DateGetter): sources_node = 'bill action table' disable_aggregator_funcs = True text_fields = ( ('action_by', 'organization'), ('action', 'text'), 'version', 'result', 'journal_page', ) def get_detail_viewtype(self): return BillsDetailAction def get_detail_url(self): return self.get_media_url('action_details') def get_date(self): return self._get_date('date') def _get_media(self, label): '''Given a field label, get it's url (if any) and send a head request to determine the content_type. Return a dict. ''' data = self.get_field_data(label) url = data.get_url() if url is None: raise self.SkipItem() self.info('Sending HEAD request for %r' % url) media_type = 'application/pdf' return dict( name=data.get_text(), links=[dict( url=data.get_url(), media_type=media_type)]) @make_item('media', wrapwith=list) def gen_media(self): for label in self.get_config_value('pupa_media'): try: yield self._get_media(label) except self.SkipItem: continue class BillsDetailAction(DetailView, ActionBase): sources_note = 'bill action detail' text_fields = ( 'file_number', 'type', 'title', 'mover', 'seconder', 'result', 'agenda_note', 'minutes_note', 'action', 'action_text') @make_item('votes', wrapwith=list) def gen_votes(self): table_path = self.get_config_value('table_class') Table = resolve_name(table_path) yield from self.make_child(Table, self) @make_item('sources', wrapwith=list) def gen_sources(self): yield dict(url=self.url, note='action detail') class BillsDetailActionTable(Table, ActionBase): sources_note = 'bill action detail table' def get_table_cell_type(self): path = self.get_config_value('tablecell_class') return resolve_name(path) def get_table_row_type(self): path = self.get_config_value('tablerow_class') return resolve_name(path) class BillsDetailActionTableRow(TableRow, ActionBase): sources_node = 'bill action detail table' text_fields = ('person', 'vote') def _get_date(date): if isinstance(date, datetime.datetime): return date.strftime('%Y-%m-%d') else: return date class ActionAdapter(Adapter): aliases = [('text', 'description')] extras_keys = ['version', 'media', 'result'] drop_keys = ['sources', 'journal_page'] #make_item('date') def get_date(self): return _get_date(self.data['date']) class VoteAdapter(Adapter): pupa_model = pupa.scrape.Vote text_fields = ['organization'] aliases = [ ('text', 'motion_text'), ] drop_keys = ['date'] extras_keys = ['version', 'media', 'journal_page'] #make_item('identifier') def get_identifier(self): '''The internal legistar bill id and guid found in the detail page url. ''' i = self.data.pop('i') for source in self.data['sources']: if not 'historydetail' in source['url'].lower(): continue url = urlparse(source['url']) ids = {} for idtype, ident in parse_qsl(url.query): if idtype == 'options': continue ids[idtype.lower()] = ident return ids['guid'] # The vote has no "action details" page, thus no identifier. # Fudge one based on the bill's guid. for source in self.bill_adapter.data['identifiers']: if source['scheme'] != 'legistar_guid': continue return '%s-vote%d' % (source['identifier'], i) #make_item('start_date') def get_date(self): return _get_date(self.data.get('date')) #make_item('result') def get_result(self): if not self.data['result']: raise self.SkipItem() result = self.get_vote_result(self.data['result']) return result #make_item('votes', wrapwith=list) def gen_votes(self): for data in self.data['votes']: if not data: continue res = {} res['option'] = self.get_vote_option(data['vote']) res['note'] = data['vote'] res['voter'] = data['person'] yield res def get_instance(self, **extra_instance_data): data = self.get_instance_data() data.update(extra_instance_data) motion_text = data['motion_text'] data['classification'] = self.classify_motion_text(motion_text) # Drop the org if necessary. When org is the top-level org, omit. if self.should_drop_organization(data): data.pop('organization', None) vote_data_list = data.pop('votes') extras = data.pop('extras') sources = data.pop('sources') data.pop('i', None) vote = self.pupa_model(**data) counts = collections.Counter() for vote_data in vote_data_list: counts[vote_data['option']] += 1 vote.vote(**vote_data) for option, value in counts.items(): vote.set_count(option, value) for source in sources: vote.add_source(**source) vote.extras.update(extras) # Skip no-result "votes" # https://sfgov.legistar.com/LegislationDetail.aspx?ID=1866659&GUID=A23A12AB-C833-4235-81A1-02AD7B8E7CF0&Options=Advanced&Search if vote.result is None: return return vote # ------------------------------------------------------------------------ # Overridables # ------------------------------------------------------------------------ def get_vote_result(self, result): '''Noramalizes the vote result value using the default values on Config base, possibly overridded by jxn.BILL_VOTE_RESULT_MAP. ''' result = result.replace('-', ' ').lower() result = self.cfg._BILL_VOTE_RESULT_MAP[result] return result def get_vote_option(self, option_text): '''Noramalizes the vote option value using the default values on Config base, possibly overridded by jxn.BILL_VOTE_OPTION_MAP. ''' option_text = option_text.replace('-', ' ').lower() return self.cfg._BILL_VOTE_OPTION_MAP[option_text] def should_drop_organization(self, data): '''If this function returns True, the org is dropped from the vote obj. XXX: Right now, always drops the org. ''' return True def classify_motion_text(self, motion_text): '''Jurisdiction configs can override this to determine how vote motions will be classified. ''' return [] class BillsAdapter(Adapter): pupa_model = pupa.scrape.Bill aliases = [ ('file_number', 'identifier'), ] extras_keys = [ 'law_number', 'status'] #make_item('classification') def get_classn(self): return self.get_bill_classification(self.data.pop('type')) #make_item('actions', wrapwith=list) def gen_actions(self): for data in self.data.get('actions'): data = dict(data) data.pop('votes') action = self.make_child(ActionAdapter, data).get_instance_data() if action['description'] is None: action['description'] = '' yield action #make_item('sponsorships') def get_sponsorships(self): return self.data.get('sponsors', []) #make_item('votes', wrapwith=list) def gen_votes(self): for i, data in enumerate(self.data.get('actions')): data['i'] = i converter = self.make_child(VoteAdapter, data) converter.bill_adapter = self more_data = dict( legislative_session=self.data['legislative_session']) vote = converter.get_instance(**more_data) if vote is not None and vote.votes: yield vote #make_item('subject') def _gen_subjects(self, wrapwith=list): yield from self.gen_subjects() def get_instance(self): '''Build a pupa instance from the data. ''' data = self.get_instance_data() data_copy = dict(data) # Allow jxns to define what bills get dropped. if self.should_drop_bill(data_copy): return bill = pupa.scrape.Bill( identifier=data['identifier'], legislative_session=data['legislative_session'], classification=data.get('classification', []), title=data['title'], ) for action in data.pop('actions'): action.pop('extras') self.drop_action_organization(action) bill.add_action(**action) for sponsorship in data.pop('sponsorships'): if not self.should_drop_sponsor(sponsorship): kwargs = dict( classification=self.get_sponsor_classification(sponsorship), entity_type=self.get_sponsor_entity_type(sponsorship), primary=self.get_sponsor_primary(sponsorship)) kwargs.update(sponsorship) bill.add_sponsorship(**kwargs) for source in data.pop('sources'): bill.add_source(**source) bill.extras.update(data.pop('extras')) for identifier in data.pop('identifiers'): bill.add_identifier(**identifier) if bill.title is None: bill.title = '' yield bill for vote in data.pop('votes'): vote.set_bill(bill) self.vote_cache[vote.identifier] = vote yield vote @CachedAttr def vote_cache(self): '''So we don't dupe any votes. Maps identifier to vote obj. ''' return {} # ------------------------------------------------------------------------ # Overridables: sponsorships # ------------------------------------------------------------------------ def should_drop_sponsor(self, data): '''If this function retruns True, the sponsor is dropped. ''' return False def get_sponsor_classification(self, data): '''Return the sponsor's pupa classification. Legistar generally doesn't provide any info like this, so we just return "". ''' return 'sponsor' def get_sponsor_entity_type(self, data): '''Return the sponsor's pupa entity type. ''' return 'person' def get_sponsor_primary(self, data): '''Return whether the sponsor is primary. Legistar generally doesn't provide this. ''' return False # ------------------------------------------------------------------------ # Overridables: actions # ------------------------------------------------------------------------ def drop_action_organization(self, data): ''' XXX: This temporarily drops the action['organization'] from all actions. See pupa issue #105 https://github.com/opencivicdata/pupa/issues/105/ When the organization is the top-level org, it doesn't get set on the action. ''' data.pop('organization', None) # ------------------------------------------------------------------------ # Overridables: miscellaneous # ------------------------------------------------------------------------ def get_bill_classification(self, billtype): '''Convert the legistar bill `type` column into a pupa classification array. ''' # Try to get the classn from the subtype. classn = getattr(self, '_BILL_CLASSIFICATIONS', {}) classn = dict(classn).get(billtype) if classn is not None: return [classn] # Bah, no matches--try to guess it. type_lower = billtype.lower() for classn in dict(ocd_common.BILL_CLASSIFICATION_CHOICES): if classn in type_lower: return [classn] # None found; return emtpy array. return []
class Dategetter: """Parse a date using the datetime format string defined in the current jxn's config. """ def _get_date(self, label_text): fmt = self.get_config_value('datetime_format') text = self.get_field_text(label_text) if text is not None: dt = datetime.strptime(text, fmt) dt = self.cfg.datetime_add_tz(dt) return dt class Billsfields(FieldAggregator, DateGetter): text_fields = ('law_number', 'type', 'status', 'name', 'version', 'sponsor_office') def get_intro_data(self): return self._get_date('intro_date') def get_file_created(self): return self._get_date('file_created') def gen_sources(self): grouped = collections.defaultdict(set) for (note, url) in self.chainmap['sources'].items(): grouped[url].add(note) for (url, notes) in grouped.items(): yield dict(url=url, note=', '.join(sorted(notes))) class Billssearchform(FirefoxForm): """Model the legistar "Legislation" search form. """ sources_note = 'bill search table' def is_advanced_search(self): switch_el_id = self.cfg.BILL_SEARCH_SWITCH_EL_ID switch_el = self.firefox.find_element_by_id(switch_el_id) switch_el_text = switch_el.text.lower() if self.cfg.BILL_SEARCH_SWITCH_SIMPLE in switch_el_text: return True return False def switch_to_advanced_search(self): switch_el_id = self.cfg.BILL_SEARCH_SWITCH_EL_ID switch_el = self.firefox.find_element_by_id(switch_el_id) switch_el.click() def fill_out_form(self): if not self.is_advanced_search(): self.switch_to_advanced_search() max_results_id = 'ctl00_ContentPlaceHolder1_lstMax' self.set_dropdown(max_results_id, 'All') years_id = 'ctl00_ContentPlaceHolder1_lstYearsAdvanced' self.set_dropdown(years_id, 'This Year') class Billsdetailview(DetailView, BillsFields): sources_note = 'bill detail' text_fields = ('version', 'name') def get_file_number(self): return self.get_field_text('file_number') def get_title(self): title = self.get_field_text('title') if not title: title = self.get_field_text('type') return title def get_agenda_date(self): return self._get_date('agenda') def get_enactment_date(self): return self._get_date('enactment_date') def get_final_action(self): return self._get_date('final_action') def gen_sponsors(self): sponsors = self.get_field_text('sponsors') for name in re.split(',\\s+', sponsors): name = name.strip() if name: yield dict(name=name) def gen_documents(self): for el in self.xpath('attachments', './/a'): data = element_accessor(el) url = data.get_url() media_type = 'application/pdf' yield dict(name=data.get_text(), links=[dict(url=data.get_url(), media_type=media_type)]) def gen_action(self): yield from self.Form(self) def gen_identifiers(self): """Yield out the internal legistar bill id and guid found in the detail page url. """ detail_url = self.chainmap['sources'][self.sources_note] url = urlparse(detail_url) for (idtype, ident) in parse_qsl(url.query): if idtype == 'options' or ident == 'Advanced': continue yield dict(scheme='legistar_' + idtype.lower(), identifier=ident) def get_legislative_session(self): dates = [] labels = ('agenda', 'created') for label in labels: labeltext = self.get_label_text(label, skipitem=False) if labeltext not in self.field_data.keys(): continue if not self.field_data[labeltext]: continue data = self.field_data[labeltext][0] fmt = self.get_config_value('datetime_format') text = data.get_text() if text is not None: dt = datetime.strptime(text, fmt) dt = self.cfg.datetime_add_tz(dt) dates.append(dt) (_, actions) = self.gen_action() for action in actions: dates.append(action['date']) if dates: return str(max(dates).year) self.critical('Need session date.') class Billsdetailtablerow(TableRow, FieldAggregator, DateGetter): sources_node = 'bill action table' disable_aggregator_funcs = True text_fields = (('action_by', 'organization'), ('action', 'text'), 'version', 'result', 'journal_page') def get_detail_viewtype(self): return BillsDetailAction def get_detail_url(self): return self.get_media_url('action_details') def get_date(self): return self._get_date('date') def _get_media(self, label): """Given a field label, get it's url (if any) and send a head request to determine the content_type. Return a dict. """ data = self.get_field_data(label) url = data.get_url() if url is None: raise self.SkipItem() self.info('Sending HEAD request for %r' % url) media_type = 'application/pdf' return dict(name=data.get_text(), links=[dict(url=data.get_url(), media_type=media_type)]) @make_item('media', wrapwith=list) def gen_media(self): for label in self.get_config_value('pupa_media'): try: yield self._get_media(label) except self.SkipItem: continue class Billsdetailaction(DetailView, ActionBase): sources_note = 'bill action detail' text_fields = ('file_number', 'type', 'title', 'mover', 'seconder', 'result', 'agenda_note', 'minutes_note', 'action', 'action_text') @make_item('votes', wrapwith=list) def gen_votes(self): table_path = self.get_config_value('table_class') table = resolve_name(table_path) yield from self.make_child(Table, self) @make_item('sources', wrapwith=list) def gen_sources(self): yield dict(url=self.url, note='action detail') class Billsdetailactiontable(Table, ActionBase): sources_note = 'bill action detail table' def get_table_cell_type(self): path = self.get_config_value('tablecell_class') return resolve_name(path) def get_table_row_type(self): path = self.get_config_value('tablerow_class') return resolve_name(path) class Billsdetailactiontablerow(TableRow, ActionBase): sources_node = 'bill action detail table' text_fields = ('person', 'vote') def _get_date(date): if isinstance(date, datetime.datetime): return date.strftime('%Y-%m-%d') else: return date class Actionadapter(Adapter): aliases = [('text', 'description')] extras_keys = ['version', 'media', 'result'] drop_keys = ['sources', 'journal_page'] def get_date(self): return _get_date(self.data['date']) class Voteadapter(Adapter): pupa_model = pupa.scrape.Vote text_fields = ['organization'] aliases = [('text', 'motion_text')] drop_keys = ['date'] extras_keys = ['version', 'media', 'journal_page'] def get_identifier(self): """The internal legistar bill id and guid found in the detail page url. """ i = self.data.pop('i') for source in self.data['sources']: if not 'historydetail' in source['url'].lower(): continue url = urlparse(source['url']) ids = {} for (idtype, ident) in parse_qsl(url.query): if idtype == 'options': continue ids[idtype.lower()] = ident return ids['guid'] for source in self.bill_adapter.data['identifiers']: if source['scheme'] != 'legistar_guid': continue return '%s-vote%d' % (source['identifier'], i) def get_date(self): return _get_date(self.data.get('date')) def get_result(self): if not self.data['result']: raise self.SkipItem() result = self.get_vote_result(self.data['result']) return result def gen_votes(self): for data in self.data['votes']: if not data: continue res = {} res['option'] = self.get_vote_option(data['vote']) res['note'] = data['vote'] res['voter'] = data['person'] yield res def get_instance(self, **extra_instance_data): data = self.get_instance_data() data.update(extra_instance_data) motion_text = data['motion_text'] data['classification'] = self.classify_motion_text(motion_text) if self.should_drop_organization(data): data.pop('organization', None) vote_data_list = data.pop('votes') extras = data.pop('extras') sources = data.pop('sources') data.pop('i', None) vote = self.pupa_model(**data) counts = collections.Counter() for vote_data in vote_data_list: counts[vote_data['option']] += 1 vote.vote(**vote_data) for (option, value) in counts.items(): vote.set_count(option, value) for source in sources: vote.add_source(**source) vote.extras.update(extras) if vote.result is None: return return vote def get_vote_result(self, result): """Noramalizes the vote result value using the default values on Config base, possibly overridded by jxn.BILL_VOTE_RESULT_MAP. """ result = result.replace('-', ' ').lower() result = self.cfg._BILL_VOTE_RESULT_MAP[result] return result def get_vote_option(self, option_text): """Noramalizes the vote option value using the default values on Config base, possibly overridded by jxn.BILL_VOTE_OPTION_MAP. """ option_text = option_text.replace('-', ' ').lower() return self.cfg._BILL_VOTE_OPTION_MAP[option_text] def should_drop_organization(self, data): """If this function returns True, the org is dropped from the vote obj. XXX: Right now, always drops the org. """ return True def classify_motion_text(self, motion_text): """Jurisdiction configs can override this to determine how vote motions will be classified. """ return [] class Billsadapter(Adapter): pupa_model = pupa.scrape.Bill aliases = [('file_number', 'identifier')] extras_keys = ['law_number', 'status'] def get_classn(self): return self.get_bill_classification(self.data.pop('type')) def gen_actions(self): for data in self.data.get('actions'): data = dict(data) data.pop('votes') action = self.make_child(ActionAdapter, data).get_instance_data() if action['description'] is None: action['description'] = '' yield action def get_sponsorships(self): return self.data.get('sponsors', []) def gen_votes(self): for (i, data) in enumerate(self.data.get('actions')): data['i'] = i converter = self.make_child(VoteAdapter, data) converter.bill_adapter = self more_data = dict(legislative_session=self.data['legislative_session']) vote = converter.get_instance(**more_data) if vote is not None and vote.votes: yield vote def _gen_subjects(self, wrapwith=list): yield from self.gen_subjects() def get_instance(self): """Build a pupa instance from the data. """ data = self.get_instance_data() data_copy = dict(data) if self.should_drop_bill(data_copy): return bill = pupa.scrape.Bill(identifier=data['identifier'], legislative_session=data['legislative_session'], classification=data.get('classification', []), title=data['title']) for action in data.pop('actions'): action.pop('extras') self.drop_action_organization(action) bill.add_action(**action) for sponsorship in data.pop('sponsorships'): if not self.should_drop_sponsor(sponsorship): kwargs = dict(classification=self.get_sponsor_classification(sponsorship), entity_type=self.get_sponsor_entity_type(sponsorship), primary=self.get_sponsor_primary(sponsorship)) kwargs.update(sponsorship) bill.add_sponsorship(**kwargs) for source in data.pop('sources'): bill.add_source(**source) bill.extras.update(data.pop('extras')) for identifier in data.pop('identifiers'): bill.add_identifier(**identifier) if bill.title is None: bill.title = '' yield bill for vote in data.pop('votes'): vote.set_bill(bill) self.vote_cache[vote.identifier] = vote yield vote @CachedAttr def vote_cache(self): """So we don't dupe any votes. Maps identifier to vote obj. """ return {} def should_drop_sponsor(self, data): """If this function retruns True, the sponsor is dropped. """ return False def get_sponsor_classification(self, data): """Return the sponsor's pupa classification. Legistar generally doesn't provide any info like this, so we just return "". """ return 'sponsor' def get_sponsor_entity_type(self, data): """Return the sponsor's pupa entity type. """ return 'person' def get_sponsor_primary(self, data): """Return whether the sponsor is primary. Legistar generally doesn't provide this. """ return False def drop_action_organization(self, data): """ XXX: This temporarily drops the action['organization'] from all actions. See pupa issue #105 https://github.com/opencivicdata/pupa/issues/105/ When the organization is the top-level org, it doesn't get set on the action. """ data.pop('organization', None) def get_bill_classification(self, billtype): """Convert the legistar bill `type` column into a pupa classification array. """ classn = getattr(self, '_BILL_CLASSIFICATIONS', {}) classn = dict(classn).get(billtype) if classn is not None: return [classn] type_lower = billtype.lower() for classn in dict(ocd_common.BILL_CLASSIFICATION_CHOICES): if classn in type_lower: return [classn] return []
n = int(input()) alph = ["A",'B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','Q','X','Y','Z'] boxes = [] for x in range(n): box = [] length = int(input()) for y in range(length): box.append([]) for i in range(length): box[y].append(".") boxes.append(box) letter = int((length - 1)/2) for i in range(letter+1): for x in range(length-(i*2)): for y in range(length-(i*2)): box[x+i][y+i] = alph[letter-i] c = 0 for box in boxes: c += 1 for x in box: for y in x: print(y, end="") print() if c < len(boxes): print()
n = int(input()) alph = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'Q', 'X', 'Y', 'Z'] boxes = [] for x in range(n): box = [] length = int(input()) for y in range(length): box.append([]) for i in range(length): box[y].append('.') boxes.append(box) letter = int((length - 1) / 2) for i in range(letter + 1): for x in range(length - i * 2): for y in range(length - i * 2): box[x + i][y + i] = alph[letter - i] c = 0 for box in boxes: c += 1 for x in box: for y in x: print(y, end='') print() if c < len(boxes): print()
PROCESS_CREATE = 0 PROCESS_EDIT = 1 PROCESS_VIEW = 2 PROCESS_DELETE = 3 PROCESS_EDIT_DELETE = 4 # Edit with delete button PROCESS_VIEW_EDIT = 5 # View with edit button PERMISSION_DISABLE = 2 PERMISSION_ON = 1 PERMISSION_OFF = 0 PERMISSION_AUTHENTICATED = 3 PERMISSION_STAFF = 4 PERMISSION_METHOD = 5 class ProcessSetup: def __init__(self, modal_title, django_permission, class_attribute, fallback): self.modal_title = modal_title self.django_permission = django_permission self.class_attribute = class_attribute self.fallback = fallback process_data = { PROCESS_CREATE: ProcessSetup('New', ['add'], 'permission_create', None), PROCESS_EDIT: ProcessSetup('Edit', ['change'], 'permission_edit', PROCESS_VIEW), PROCESS_VIEW: ProcessSetup('View', ['view'], 'permission_view', None), PROCESS_DELETE: ProcessSetup('Delete', ['delete'], 'permission_delete', None), PROCESS_EDIT_DELETE: ProcessSetup('Edit', ['delete', 'change'], 'permission_delete', PROCESS_EDIT), PROCESS_VIEW_EDIT: ProcessSetup('View', ['change'], 'permission_edit', PROCESS_VIEW), } modal_url_type = { 'view': PROCESS_VIEW, 'viewedit': PROCESS_VIEW_EDIT, 'edit': PROCESS_EDIT, 'editdelete': PROCESS_EDIT_DELETE, 'delete': PROCESS_DELETE, }
process_create = 0 process_edit = 1 process_view = 2 process_delete = 3 process_edit_delete = 4 process_view_edit = 5 permission_disable = 2 permission_on = 1 permission_off = 0 permission_authenticated = 3 permission_staff = 4 permission_method = 5 class Processsetup: def __init__(self, modal_title, django_permission, class_attribute, fallback): self.modal_title = modal_title self.django_permission = django_permission self.class_attribute = class_attribute self.fallback = fallback process_data = {PROCESS_CREATE: process_setup('New', ['add'], 'permission_create', None), PROCESS_EDIT: process_setup('Edit', ['change'], 'permission_edit', PROCESS_VIEW), PROCESS_VIEW: process_setup('View', ['view'], 'permission_view', None), PROCESS_DELETE: process_setup('Delete', ['delete'], 'permission_delete', None), PROCESS_EDIT_DELETE: process_setup('Edit', ['delete', 'change'], 'permission_delete', PROCESS_EDIT), PROCESS_VIEW_EDIT: process_setup('View', ['change'], 'permission_edit', PROCESS_VIEW)} modal_url_type = {'view': PROCESS_VIEW, 'viewedit': PROCESS_VIEW_EDIT, 'edit': PROCESS_EDIT, 'editdelete': PROCESS_EDIT_DELETE, 'delete': PROCESS_DELETE}
# Copyright (c) 2020 Greg Dubicki # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # # See the License for the specific language governing permissions and # limitations under the License. # # MIT License # # Copyright (c) 2018 Shane Wang # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # -*- coding: utf-8 -*- class CacheNode(object): def __init__(self, key, value, freq_node, pre, nxt): self.key = key self.value = value self.freq_node = freq_node self.pre = pre # previous CacheNode self.nxt = nxt # next CacheNode def free_myself(self): if self.freq_node.cache_head == self.freq_node.cache_tail: self.freq_node.cache_head = self.freq_node.cache_tail = None elif self.freq_node.cache_head == self: self.nxt.pre = None self.freq_node.cache_head = self.nxt elif self.freq_node.cache_tail == self: self.pre.nxt = None self.freq_node.cache_tail = self.pre else: self.pre.nxt = self.nxt self.nxt.pre = self.pre self.pre = None self.nxt = None self.freq_node = None class FreqNode(object): def __init__(self, freq, pre, nxt): self.freq = freq self.pre = pre # previous FreqNode self.nxt = nxt # next FreqNode self.cache_head = None # CacheNode head under this FreqNode self.cache_tail = None # CacheNode tail under this FreqNode def count_caches(self): if self.cache_head is None and self.cache_tail is None: return 0 elif self.cache_head == self.cache_tail: return 1 else: return "2+" def remove(self): if self.pre is not None: self.pre.nxt = self.nxt if self.nxt is not None: self.nxt.pre = self.pre pre = self.pre nxt = self.nxt self.pre = self.nxt = self.cache_head = self.cache_tail = None return (pre, nxt) def pop_head_cache(self): if self.cache_head is None and self.cache_tail is None: return None elif self.cache_head == self.cache_tail: cache_head = self.cache_head self.cache_head = self.cache_tail = None return cache_head else: cache_head = self.cache_head self.cache_head.nxt.pre = None self.cache_head = self.cache_head.nxt return cache_head def append_cache_to_tail(self, cache_node): cache_node.freq_node = self if self.cache_head is None and self.cache_tail is None: self.cache_head = self.cache_tail = cache_node else: cache_node.pre = self.cache_tail cache_node.nxt = None self.cache_tail.nxt = cache_node self.cache_tail = cache_node def insert_after_me(self, freq_node): freq_node.pre = self freq_node.nxt = self.nxt if self.nxt is not None: self.nxt.pre = freq_node self.nxt = freq_node def insert_before_me(self, freq_node): if self.pre is not None: self.pre.nxt = freq_node freq_node.pre = self.pre freq_node.nxt = self self.pre = freq_node class LFUCache(object): def __init__(self, capacity): self.cache = {} # {key: cache_node} self.capacity = capacity self.freq_link_head = None def get(self, key): if key in self.cache: cache_node = self.cache[key] freq_node = cache_node.freq_node value = cache_node.value self.move_forward(cache_node, freq_node) return value else: return -1 def set(self, key, value): if self.capacity <= 0: return -1 if key not in self.cache: if len(self.cache) >= self.capacity: self.dump_cache() self.create_cache(key, value) else: cache_node = self.cache[key] freq_node = cache_node.freq_node cache_node.value = value self.move_forward(cache_node, freq_node) def move_forward(self, cache_node, freq_node): if freq_node.nxt is None or freq_node.nxt.freq != freq_node.freq + 1: target_freq_node = FreqNode(freq_node.freq + 1, None, None) target_empty = True else: target_freq_node = freq_node.nxt target_empty = False cache_node.free_myself() target_freq_node.append_cache_to_tail(cache_node) if target_empty: freq_node.insert_after_me(target_freq_node) if freq_node.count_caches() == 0: if self.freq_link_head == freq_node: self.freq_link_head = target_freq_node freq_node.remove() def dump_cache(self): head_freq_node = self.freq_link_head # close the session when removing it from cache session = self.cache.pop(head_freq_node.cache_head.key) session.close() head_freq_node.pop_head_cache() if head_freq_node.count_caches() == 0: self.freq_link_head = head_freq_node.nxt head_freq_node.remove() def create_cache(self, key, value): cache_node = CacheNode(key, value, None, None, None) self.cache[key] = cache_node if self.freq_link_head is None or self.freq_link_head.freq != 0: new_freq_node = FreqNode(0, None, None) new_freq_node.append_cache_to_tail(cache_node) if self.freq_link_head is not None: self.freq_link_head.insert_before_me(new_freq_node) self.freq_link_head = new_freq_node else: self.freq_link_head.append_cache_to_tail(cache_node)
class Cachenode(object): def __init__(self, key, value, freq_node, pre, nxt): self.key = key self.value = value self.freq_node = freq_node self.pre = pre self.nxt = nxt def free_myself(self): if self.freq_node.cache_head == self.freq_node.cache_tail: self.freq_node.cache_head = self.freq_node.cache_tail = None elif self.freq_node.cache_head == self: self.nxt.pre = None self.freq_node.cache_head = self.nxt elif self.freq_node.cache_tail == self: self.pre.nxt = None self.freq_node.cache_tail = self.pre else: self.pre.nxt = self.nxt self.nxt.pre = self.pre self.pre = None self.nxt = None self.freq_node = None class Freqnode(object): def __init__(self, freq, pre, nxt): self.freq = freq self.pre = pre self.nxt = nxt self.cache_head = None self.cache_tail = None def count_caches(self): if self.cache_head is None and self.cache_tail is None: return 0 elif self.cache_head == self.cache_tail: return 1 else: return '2+' def remove(self): if self.pre is not None: self.pre.nxt = self.nxt if self.nxt is not None: self.nxt.pre = self.pre pre = self.pre nxt = self.nxt self.pre = self.nxt = self.cache_head = self.cache_tail = None return (pre, nxt) def pop_head_cache(self): if self.cache_head is None and self.cache_tail is None: return None elif self.cache_head == self.cache_tail: cache_head = self.cache_head self.cache_head = self.cache_tail = None return cache_head else: cache_head = self.cache_head self.cache_head.nxt.pre = None self.cache_head = self.cache_head.nxt return cache_head def append_cache_to_tail(self, cache_node): cache_node.freq_node = self if self.cache_head is None and self.cache_tail is None: self.cache_head = self.cache_tail = cache_node else: cache_node.pre = self.cache_tail cache_node.nxt = None self.cache_tail.nxt = cache_node self.cache_tail = cache_node def insert_after_me(self, freq_node): freq_node.pre = self freq_node.nxt = self.nxt if self.nxt is not None: self.nxt.pre = freq_node self.nxt = freq_node def insert_before_me(self, freq_node): if self.pre is not None: self.pre.nxt = freq_node freq_node.pre = self.pre freq_node.nxt = self self.pre = freq_node class Lfucache(object): def __init__(self, capacity): self.cache = {} self.capacity = capacity self.freq_link_head = None def get(self, key): if key in self.cache: cache_node = self.cache[key] freq_node = cache_node.freq_node value = cache_node.value self.move_forward(cache_node, freq_node) return value else: return -1 def set(self, key, value): if self.capacity <= 0: return -1 if key not in self.cache: if len(self.cache) >= self.capacity: self.dump_cache() self.create_cache(key, value) else: cache_node = self.cache[key] freq_node = cache_node.freq_node cache_node.value = value self.move_forward(cache_node, freq_node) def move_forward(self, cache_node, freq_node): if freq_node.nxt is None or freq_node.nxt.freq != freq_node.freq + 1: target_freq_node = freq_node(freq_node.freq + 1, None, None) target_empty = True else: target_freq_node = freq_node.nxt target_empty = False cache_node.free_myself() target_freq_node.append_cache_to_tail(cache_node) if target_empty: freq_node.insert_after_me(target_freq_node) if freq_node.count_caches() == 0: if self.freq_link_head == freq_node: self.freq_link_head = target_freq_node freq_node.remove() def dump_cache(self): head_freq_node = self.freq_link_head session = self.cache.pop(head_freq_node.cache_head.key) session.close() head_freq_node.pop_head_cache() if head_freq_node.count_caches() == 0: self.freq_link_head = head_freq_node.nxt head_freq_node.remove() def create_cache(self, key, value): cache_node = cache_node(key, value, None, None, None) self.cache[key] = cache_node if self.freq_link_head is None or self.freq_link_head.freq != 0: new_freq_node = freq_node(0, None, None) new_freq_node.append_cache_to_tail(cache_node) if self.freq_link_head is not None: self.freq_link_head.insert_before_me(new_freq_node) self.freq_link_head = new_freq_node else: self.freq_link_head.append_cache_to_tail(cache_node)
def solution(clothes): answer = {} for i in clothes: if i[1] in answer: answer[i[1]]+=1 else: answer[i[1]] = 1 cnt = 1 for i in answer.values(): cnt *= (i+1) return cnt - 1
def solution(clothes): answer = {} for i in clothes: if i[1] in answer: answer[i[1]] += 1 else: answer[i[1]] = 1 cnt = 1 for i in answer.values(): cnt *= i + 1 return cnt - 1
# Request Link and Long Polling Use TELEGRAM_TOKEN = '' WEBHOOK_URL = '' TELEGRAM_BASE = f'https://api.telegram.org/bot{TELEGRAM_TOKEN}' TELEGRAM_WEBHOOK_URL = TELEGRAM_BASE + f'/setWebhook?url={WEBHOOK_URL}/hook' FUGLE_API_TOKEN = '' # Other Chatbot Token EXAMPLE_TOKEN = '' # WEBHOOK_URL = ''
telegram_token = '' webhook_url = '' telegram_base = f'https://api.telegram.org/bot{TELEGRAM_TOKEN}' telegram_webhook_url = TELEGRAM_BASE + f'/setWebhook?url={WEBHOOK_URL}/hook' fugle_api_token = '' example_token = ''
# Speed Fine Problem # input limit = int(input('Enter the speed limit: ')) speed = int(input('Enter the recorded speed of the car: ')) # processing & output if speed <= limit: print('Congratulations, you are within the speed limit!') else: difference = speed - limit if difference > 30: print('You are speeding and your fine is $500.') elif difference > 20: print('You are speeding and your fine is $270.') else: print('You are speeding and your fine is $100.')
limit = int(input('Enter the speed limit: ')) speed = int(input('Enter the recorded speed of the car: ')) if speed <= limit: print('Congratulations, you are within the speed limit!') else: difference = speed - limit if difference > 30: print('You are speeding and your fine is $500.') elif difference > 20: print('You are speeding and your fine is $270.') else: print('You are speeding and your fine is $100.')
# coding=utf-8 """ Data Integration """ __author__ = 'Seray Beser' __copyright__ = 'Copyright 2018 Seray Beser' __license__ = 'Apache License 2.0' __version__ = '0.0.1' __email__ = 'seraybeserr@gmail.com' __status__ = 'Development' class DataIntegration(object): """ Data Integration """ def __init__(self, data): self.data = data
""" Data Integration """ __author__ = 'Seray Beser' __copyright__ = 'Copyright 2018 Seray Beser' __license__ = 'Apache License 2.0' __version__ = '0.0.1' __email__ = 'seraybeserr@gmail.com' __status__ = 'Development' class Dataintegration(object): """ Data Integration """ def __init__(self, data): self.data = data
# # PySNMP MIB module DEVICE (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DEVICE # Produced by pysmi-0.3.4 at Mon Apr 29 18:26:39 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") IpAddress, Unsigned32, ObjectIdentity, iso, ModuleIdentity, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, MibIdentifier, NotificationType, Integer32, enterprises, Counter32, Gauge32, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "Unsigned32", "ObjectIdentity", "iso", "ModuleIdentity", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "MibIdentifier", "NotificationType", "Integer32", "enterprises", "Counter32", "Gauge32", "TimeTicks") DisplayString, MacAddress, RowStatus, TruthValue, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "MacAddress", "RowStatus", "TruthValue", "TextualConvention") pepwave = MibIdentifier((1, 3, 6, 1, 4, 1, 27662)) productMib = MibIdentifier((1, 3, 6, 1, 4, 1, 27662, 200)) generalMib = MibIdentifier((1, 3, 6, 1, 4, 1, 27662, 200, 1)) deviceMib = MibIdentifier((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1)) deviceInfo = ModuleIdentity((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1)) if mibBuilder.loadTexts: deviceInfo.setLastUpdated('201305210000Z') if mibBuilder.loadTexts: deviceInfo.setOrganization('PEPWAVE') deviceInfoSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 1)) deviceModel = MibScalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 1, 1), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceModel.setStatus('current') deviceSerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceSerialNumber.setStatus('current') deviceFirmwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 1, 3), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceFirmwareVersion.setStatus('current') deviceInfoTime = MibIdentifier((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 2)) deviceSystemTime = MibScalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 2, 1), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceSystemTime.setStatus('current') deviceSystemUpTime = MibScalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 2, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceSystemUpTime.setStatus('current') deviceInfoUsage = MibIdentifier((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 3)) deviceCpuLoad = MibScalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 3, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceCpuLoad.setStatus('current') deviceTotalMemory = MibScalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 3, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceTotalMemory.setStatus('current') deviceMemoryUsage = MibScalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 3, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceMemoryUsage.setStatus('current') mibBuilder.exportSymbols("DEVICE", deviceInfoTime=deviceInfoTime, deviceCpuLoad=deviceCpuLoad, deviceSerialNumber=deviceSerialNumber, deviceInfoSystem=deviceInfoSystem, pepwave=pepwave, deviceInfo=deviceInfo, deviceModel=deviceModel, deviceFirmwareVersion=deviceFirmwareVersion, deviceTotalMemory=deviceTotalMemory, PYSNMP_MODULE_ID=deviceInfo, productMib=productMib, deviceSystemTime=deviceSystemTime, deviceInfoUsage=deviceInfoUsage, generalMib=generalMib, deviceSystemUpTime=deviceSystemUpTime, deviceMib=deviceMib, deviceMemoryUsage=deviceMemoryUsage)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, single_value_constraint, constraints_union, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ConstraintsIntersection') (object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup') (ip_address, unsigned32, object_identity, iso, module_identity, counter64, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, mib_identifier, notification_type, integer32, enterprises, counter32, gauge32, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'IpAddress', 'Unsigned32', 'ObjectIdentity', 'iso', 'ModuleIdentity', 'Counter64', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'MibIdentifier', 'NotificationType', 'Integer32', 'enterprises', 'Counter32', 'Gauge32', 'TimeTicks') (display_string, mac_address, row_status, truth_value, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'MacAddress', 'RowStatus', 'TruthValue', 'TextualConvention') pepwave = mib_identifier((1, 3, 6, 1, 4, 1, 27662)) product_mib = mib_identifier((1, 3, 6, 1, 4, 1, 27662, 200)) general_mib = mib_identifier((1, 3, 6, 1, 4, 1, 27662, 200, 1)) device_mib = mib_identifier((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1)) device_info = module_identity((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1)) if mibBuilder.loadTexts: deviceInfo.setLastUpdated('201305210000Z') if mibBuilder.loadTexts: deviceInfo.setOrganization('PEPWAVE') device_info_system = mib_identifier((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 1)) device_model = mib_scalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 1, 1), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceModel.setStatus('current') device_serial_number = mib_scalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 1, 2), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceSerialNumber.setStatus('current') device_firmware_version = mib_scalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 1, 3), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceFirmwareVersion.setStatus('current') device_info_time = mib_identifier((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 2)) device_system_time = mib_scalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 2, 1), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceSystemTime.setStatus('current') device_system_up_time = mib_scalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 2, 2), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceSystemUpTime.setStatus('current') device_info_usage = mib_identifier((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 3)) device_cpu_load = mib_scalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 3, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceCpuLoad.setStatus('current') device_total_memory = mib_scalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 3, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceTotalMemory.setStatus('current') device_memory_usage = mib_scalar((1, 3, 6, 1, 4, 1, 27662, 200, 1, 1, 1, 3, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: deviceMemoryUsage.setStatus('current') mibBuilder.exportSymbols('DEVICE', deviceInfoTime=deviceInfoTime, deviceCpuLoad=deviceCpuLoad, deviceSerialNumber=deviceSerialNumber, deviceInfoSystem=deviceInfoSystem, pepwave=pepwave, deviceInfo=deviceInfo, deviceModel=deviceModel, deviceFirmwareVersion=deviceFirmwareVersion, deviceTotalMemory=deviceTotalMemory, PYSNMP_MODULE_ID=deviceInfo, productMib=productMib, deviceSystemTime=deviceSystemTime, deviceInfoUsage=deviceInfoUsage, generalMib=generalMib, deviceSystemUpTime=deviceSystemUpTime, deviceMib=deviceMib, deviceMemoryUsage=deviceMemoryUsage)
# Question # 17. Write a menu driven program to find the area of circle, square, rectangle & triangle. # Code types = ["circle", "square", "rectangle", "triangle"] print("-"*15) # 15 is length of Area Calculator. not intentional though it was a random rumber print("Area Calculator") print("-"*15) print() print("Please enter the following numbers according to the shape you want to calculate the area of.") print() for i, type in enumerate(types): print(i, ":", types[i]) print() shape = int(input()) if types[shape] == "circle": r = float(input("Randius:\n")) print("Area:", 22 / 7 * r * r) elif types[shape] == "square": a = float(input("Side length pls:\n")) print("Area:", a**2) elif types[shape] == "rectangle": s1 = float(input("Side 1:\n")) s2 = float(input("Side 2:\n")) print("Area:",s1*s2) elif types[shape] == "triangle": s1 = float(input("Side 1:\n")) s2 = float(input("Side 2:\n")) s3 = float(input("Side 3:\n")) s = (s1 + s2 + s3) / 2 print(s) print(s * (s-s1) * (s-s2) * (s-s3) ) print("Area:", ( s * (s-s1) * (s-s2) * (s-s3) ) ** 0.5 ) # Output # # --------------- # Area Calculator # --------------- # # Please enter the following numbers according to the shape you want to calculate the area of. # # 0 : circle # 1 : square # 2 : rectangle # 3 : triangle # # 3 # Side 1: # 5 # Side 2: # 5 # Side 3: # 3 # 6.5 # 51.1875 # Area: 7.1545440106270926 # Additional Comments: # None
types = ['circle', 'square', 'rectangle', 'triangle'] print('-' * 15) print('Area Calculator') print('-' * 15) print() print('Please enter the following numbers according to the shape you want to calculate the area of.') print() for (i, type) in enumerate(types): print(i, ':', types[i]) print() shape = int(input()) if types[shape] == 'circle': r = float(input('Randius:\n')) print('Area:', 22 / 7 * r * r) elif types[shape] == 'square': a = float(input('Side length pls:\n')) print('Area:', a ** 2) elif types[shape] == 'rectangle': s1 = float(input('Side 1:\n')) s2 = float(input('Side 2:\n')) print('Area:', s1 * s2) elif types[shape] == 'triangle': s1 = float(input('Side 1:\n')) s2 = float(input('Side 2:\n')) s3 = float(input('Side 3:\n')) s = (s1 + s2 + s3) / 2 print(s) print(s * (s - s1) * (s - s2) * (s - s3)) print('Area:', (s * (s - s1) * (s - s2) * (s - s3)) ** 0.5)
""".""" # import time # import logging class SCPI(object): """SCPI helper functions.""" @property def SCPI_OPT(self): return self.query(':SYSTem:OPTions?').strip('"').split(',') @property def SystemErrorQueue(self): """Get System Error Queue. :returns: List of errors """ responces = [] i, s = self.inst.query_ascii_values(':SYSTem:ERRor?', converter='s') responce = [int(i), s.strip('"')] while responce[0] != 0: responces.append(responce) i, s = self.inst.query_ascii_values(':SYSTem:ERRor?', converter='s') responce = [int(i), s.strip('"')] if len(responces) == 0: return None else: return responces def SCPI_local(self): """Go To Local.""" return self.query_float(':SYSTem:COMMunicate:GTLocal?')
""".""" class Scpi(object): """SCPI helper functions.""" @property def scpi_opt(self): return self.query(':SYSTem:OPTions?').strip('"').split(',') @property def system_error_queue(self): """Get System Error Queue. :returns: List of errors """ responces = [] (i, s) = self.inst.query_ascii_values(':SYSTem:ERRor?', converter='s') responce = [int(i), s.strip('"')] while responce[0] != 0: responces.append(responce) (i, s) = self.inst.query_ascii_values(':SYSTem:ERRor?', converter='s') responce = [int(i), s.strip('"')] if len(responces) == 0: return None else: return responces def scpi_local(self): """Go To Local.""" return self.query_float(':SYSTem:COMMunicate:GTLocal?')
####################### # Login configuration # ####################### weblab_db_username = 'weblab' weblab_db_password = 'weblab' ######################################## # User Processing Server configuration # ######################################## core_session_type = 'Memory' core_coordinator_db_username = 'weblab' core_coordinator_db_password = 'weblab' core_coordinator_laboratory_servers = { "laboratory:lab_and_experiment1@main_machine" : { "exp1|ud-dummy|Dummy experiments" : "dummy1@ud-dummy", "exp2|ud-dummy|Dummy experiments" : "dummy2@ud-dummy", "exp3|ud-dummy|Dummy experiments" : "dummy3@ud-dummy", "exp4|ud-dummy|Dummy experiments" : "dummy4@ud-dummy", "exp5|ud-dummy|Dummy experiments" : "dummy5@ud-dummy", "exp6|ud-dummy|Dummy experiments" : "dummy6@ud-dummy", "exp7|ud-dummy|Dummy experiments" : "dummy7@ud-dummy", "exp8|ud-dummy|Dummy experiments" : "dummy8@ud-dummy", "exp9|ud-dummy|Dummy experiments" : "dummy9@ud-dummy", "exp10|ud-dummy|Dummy experiments" : "dummy10@ud-dummy", "exp11|ud-dummy|Dummy experiments" : "dummy11@ud-dummy", "exp12|ud-dummy|Dummy experiments" : "dummy12@ud-dummy", "exp13|ud-dummy|Dummy experiments" : "dummy13@ud-dummy", "exp14|ud-dummy|Dummy experiments" : "dummy14@ud-dummy", "exp15|ud-dummy|Dummy experiments" : "dummy15@ud-dummy", "exp16|ud-dummy|Dummy experiments" : "dummy16@ud-dummy", "exp17|ud-dummy|Dummy experiments" : "dummy17@ud-dummy", "exp18|ud-dummy|Dummy experiments" : "dummy18@ud-dummy", "exp19|ud-dummy|Dummy experiments" : "dummy19@ud-dummy", "exp20|ud-dummy|Dummy experiments" : "dummy20@ud-dummy", "exp21|ud-dummy|Dummy experiments" : "dummy21@ud-dummy", "exp22|ud-dummy|Dummy experiments" : "dummy22@ud-dummy", "exp23|ud-dummy|Dummy experiments" : "dummy23@ud-dummy", "exp24|ud-dummy|Dummy experiments" : "dummy24@ud-dummy", "exp25|ud-dummy|Dummy experiments" : "dummy25@ud-dummy", "exp26|ud-dummy|Dummy experiments" : "dummy26@ud-dummy", "exp27|ud-dummy|Dummy experiments" : "dummy27@ud-dummy", "exp28|ud-dummy|Dummy experiments" : "dummy28@ud-dummy", "exp29|ud-dummy|Dummy experiments" : "dummy29@ud-dummy", "exp30|ud-dummy|Dummy experiments" : "dummy30@ud-dummy", "exp31|ud-dummy|Dummy experiments" : "dummy31@ud-dummy", "exp32|ud-dummy|Dummy experiments" : "dummy32@ud-dummy", "exp33|ud-dummy|Dummy experiments" : "dummy33@ud-dummy", "exp34|ud-dummy|Dummy experiments" : "dummy34@ud-dummy", "exp35|ud-dummy|Dummy experiments" : "dummy35@ud-dummy", "exp36|ud-dummy|Dummy experiments" : "dummy36@ud-dummy", "exp37|ud-dummy|Dummy experiments" : "dummy37@ud-dummy", "exp38|ud-dummy|Dummy experiments" : "dummy38@ud-dummy", "exp39|ud-dummy|Dummy experiments" : "dummy39@ud-dummy", "exp40|ud-dummy|Dummy experiments" : "dummy40@ud-dummy", }, "laboratory:lab_and_experiment2@main_machine" : { "exp41|ud-dummy|Dummy experiments" : "dummy41@ud-dummy", "exp42|ud-dummy|Dummy experiments" : "dummy42@ud-dummy", "exp43|ud-dummy|Dummy experiments" : "dummy43@ud-dummy", "exp44|ud-dummy|Dummy experiments" : "dummy44@ud-dummy", "exp45|ud-dummy|Dummy experiments" : "dummy45@ud-dummy", "exp46|ud-dummy|Dummy experiments" : "dummy46@ud-dummy", "exp47|ud-dummy|Dummy experiments" : "dummy47@ud-dummy", "exp48|ud-dummy|Dummy experiments" : "dummy48@ud-dummy", "exp49|ud-dummy|Dummy experiments" : "dummy49@ud-dummy", "exp50|ud-dummy|Dummy experiments" : "dummy50@ud-dummy", "exp51|ud-dummy|Dummy experiments" : "dummy51@ud-dummy", "exp52|ud-dummy|Dummy experiments" : "dummy52@ud-dummy", "exp53|ud-dummy|Dummy experiments" : "dummy53@ud-dummy", "exp54|ud-dummy|Dummy experiments" : "dummy54@ud-dummy", "exp55|ud-dummy|Dummy experiments" : "dummy55@ud-dummy", "exp56|ud-dummy|Dummy experiments" : "dummy56@ud-dummy", "exp57|ud-dummy|Dummy experiments" : "dummy57@ud-dummy", "exp58|ud-dummy|Dummy experiments" : "dummy58@ud-dummy", "exp59|ud-dummy|Dummy experiments" : "dummy59@ud-dummy", "exp60|ud-dummy|Dummy experiments" : "dummy60@ud-dummy", "exp61|ud-dummy|Dummy experiments" : "dummy61@ud-dummy", "exp62|ud-dummy|Dummy experiments" : "dummy62@ud-dummy", "exp63|ud-dummy|Dummy experiments" : "dummy63@ud-dummy", "exp64|ud-dummy|Dummy experiments" : "dummy64@ud-dummy", "exp65|ud-dummy|Dummy experiments" : "dummy65@ud-dummy", "exp66|ud-dummy|Dummy experiments" : "dummy66@ud-dummy", "exp67|ud-dummy|Dummy experiments" : "dummy67@ud-dummy", "exp68|ud-dummy|Dummy experiments" : "dummy68@ud-dummy", "exp69|ud-dummy|Dummy experiments" : "dummy69@ud-dummy", "exp70|ud-dummy|Dummy experiments" : "dummy70@ud-dummy", "exp71|ud-dummy|Dummy experiments" : "dummy71@ud-dummy", "exp72|ud-dummy|Dummy experiments" : "dummy72@ud-dummy", "exp73|ud-dummy|Dummy experiments" : "dummy73@ud-dummy", "exp74|ud-dummy|Dummy experiments" : "dummy74@ud-dummy", "exp75|ud-dummy|Dummy experiments" : "dummy75@ud-dummy", "exp76|ud-dummy|Dummy experiments" : "dummy76@ud-dummy", "exp77|ud-dummy|Dummy experiments" : "dummy77@ud-dummy", "exp78|ud-dummy|Dummy experiments" : "dummy78@ud-dummy", "exp79|ud-dummy|Dummy experiments" : "dummy79@ud-dummy", "exp80|ud-dummy|Dummy experiments" : "dummy80@ud-dummy", } } core_scheduling_systems = { "ud-dummy" : ("PRIORITY_QUEUE", {}), } ########################## # Database configuration # ########################## db_host = "localhost" db_database = "WebLabTests" core_universal_identifier = 'da2579d6-e3b2-11e0-a66a-00216a5807c8' core_universal_identifier_human = 'server X at Sample University' core_server_url = 'http://localhost/weblab/'
weblab_db_username = 'weblab' weblab_db_password = 'weblab' core_session_type = 'Memory' core_coordinator_db_username = 'weblab' core_coordinator_db_password = 'weblab' core_coordinator_laboratory_servers = {'laboratory:lab_and_experiment1@main_machine': {'exp1|ud-dummy|Dummy experiments': 'dummy1@ud-dummy', 'exp2|ud-dummy|Dummy experiments': 'dummy2@ud-dummy', 'exp3|ud-dummy|Dummy experiments': 'dummy3@ud-dummy', 'exp4|ud-dummy|Dummy experiments': 'dummy4@ud-dummy', 'exp5|ud-dummy|Dummy experiments': 'dummy5@ud-dummy', 'exp6|ud-dummy|Dummy experiments': 'dummy6@ud-dummy', 'exp7|ud-dummy|Dummy experiments': 'dummy7@ud-dummy', 'exp8|ud-dummy|Dummy experiments': 'dummy8@ud-dummy', 'exp9|ud-dummy|Dummy experiments': 'dummy9@ud-dummy', 'exp10|ud-dummy|Dummy experiments': 'dummy10@ud-dummy', 'exp11|ud-dummy|Dummy experiments': 'dummy11@ud-dummy', 'exp12|ud-dummy|Dummy experiments': 'dummy12@ud-dummy', 'exp13|ud-dummy|Dummy experiments': 'dummy13@ud-dummy', 'exp14|ud-dummy|Dummy experiments': 'dummy14@ud-dummy', 'exp15|ud-dummy|Dummy experiments': 'dummy15@ud-dummy', 'exp16|ud-dummy|Dummy experiments': 'dummy16@ud-dummy', 'exp17|ud-dummy|Dummy experiments': 'dummy17@ud-dummy', 'exp18|ud-dummy|Dummy experiments': 'dummy18@ud-dummy', 'exp19|ud-dummy|Dummy experiments': 'dummy19@ud-dummy', 'exp20|ud-dummy|Dummy experiments': 'dummy20@ud-dummy', 'exp21|ud-dummy|Dummy experiments': 'dummy21@ud-dummy', 'exp22|ud-dummy|Dummy experiments': 'dummy22@ud-dummy', 'exp23|ud-dummy|Dummy experiments': 'dummy23@ud-dummy', 'exp24|ud-dummy|Dummy experiments': 'dummy24@ud-dummy', 'exp25|ud-dummy|Dummy experiments': 'dummy25@ud-dummy', 'exp26|ud-dummy|Dummy experiments': 'dummy26@ud-dummy', 'exp27|ud-dummy|Dummy experiments': 'dummy27@ud-dummy', 'exp28|ud-dummy|Dummy experiments': 'dummy28@ud-dummy', 'exp29|ud-dummy|Dummy experiments': 'dummy29@ud-dummy', 'exp30|ud-dummy|Dummy experiments': 'dummy30@ud-dummy', 'exp31|ud-dummy|Dummy experiments': 'dummy31@ud-dummy', 'exp32|ud-dummy|Dummy experiments': 'dummy32@ud-dummy', 'exp33|ud-dummy|Dummy experiments': 'dummy33@ud-dummy', 'exp34|ud-dummy|Dummy experiments': 'dummy34@ud-dummy', 'exp35|ud-dummy|Dummy experiments': 'dummy35@ud-dummy', 'exp36|ud-dummy|Dummy experiments': 'dummy36@ud-dummy', 'exp37|ud-dummy|Dummy experiments': 'dummy37@ud-dummy', 'exp38|ud-dummy|Dummy experiments': 'dummy38@ud-dummy', 'exp39|ud-dummy|Dummy experiments': 'dummy39@ud-dummy', 'exp40|ud-dummy|Dummy experiments': 'dummy40@ud-dummy'}, 'laboratory:lab_and_experiment2@main_machine': {'exp41|ud-dummy|Dummy experiments': 'dummy41@ud-dummy', 'exp42|ud-dummy|Dummy experiments': 'dummy42@ud-dummy', 'exp43|ud-dummy|Dummy experiments': 'dummy43@ud-dummy', 'exp44|ud-dummy|Dummy experiments': 'dummy44@ud-dummy', 'exp45|ud-dummy|Dummy experiments': 'dummy45@ud-dummy', 'exp46|ud-dummy|Dummy experiments': 'dummy46@ud-dummy', 'exp47|ud-dummy|Dummy experiments': 'dummy47@ud-dummy', 'exp48|ud-dummy|Dummy experiments': 'dummy48@ud-dummy', 'exp49|ud-dummy|Dummy experiments': 'dummy49@ud-dummy', 'exp50|ud-dummy|Dummy experiments': 'dummy50@ud-dummy', 'exp51|ud-dummy|Dummy experiments': 'dummy51@ud-dummy', 'exp52|ud-dummy|Dummy experiments': 'dummy52@ud-dummy', 'exp53|ud-dummy|Dummy experiments': 'dummy53@ud-dummy', 'exp54|ud-dummy|Dummy experiments': 'dummy54@ud-dummy', 'exp55|ud-dummy|Dummy experiments': 'dummy55@ud-dummy', 'exp56|ud-dummy|Dummy experiments': 'dummy56@ud-dummy', 'exp57|ud-dummy|Dummy experiments': 'dummy57@ud-dummy', 'exp58|ud-dummy|Dummy experiments': 'dummy58@ud-dummy', 'exp59|ud-dummy|Dummy experiments': 'dummy59@ud-dummy', 'exp60|ud-dummy|Dummy experiments': 'dummy60@ud-dummy', 'exp61|ud-dummy|Dummy experiments': 'dummy61@ud-dummy', 'exp62|ud-dummy|Dummy experiments': 'dummy62@ud-dummy', 'exp63|ud-dummy|Dummy experiments': 'dummy63@ud-dummy', 'exp64|ud-dummy|Dummy experiments': 'dummy64@ud-dummy', 'exp65|ud-dummy|Dummy experiments': 'dummy65@ud-dummy', 'exp66|ud-dummy|Dummy experiments': 'dummy66@ud-dummy', 'exp67|ud-dummy|Dummy experiments': 'dummy67@ud-dummy', 'exp68|ud-dummy|Dummy experiments': 'dummy68@ud-dummy', 'exp69|ud-dummy|Dummy experiments': 'dummy69@ud-dummy', 'exp70|ud-dummy|Dummy experiments': 'dummy70@ud-dummy', 'exp71|ud-dummy|Dummy experiments': 'dummy71@ud-dummy', 'exp72|ud-dummy|Dummy experiments': 'dummy72@ud-dummy', 'exp73|ud-dummy|Dummy experiments': 'dummy73@ud-dummy', 'exp74|ud-dummy|Dummy experiments': 'dummy74@ud-dummy', 'exp75|ud-dummy|Dummy experiments': 'dummy75@ud-dummy', 'exp76|ud-dummy|Dummy experiments': 'dummy76@ud-dummy', 'exp77|ud-dummy|Dummy experiments': 'dummy77@ud-dummy', 'exp78|ud-dummy|Dummy experiments': 'dummy78@ud-dummy', 'exp79|ud-dummy|Dummy experiments': 'dummy79@ud-dummy', 'exp80|ud-dummy|Dummy experiments': 'dummy80@ud-dummy'}} core_scheduling_systems = {'ud-dummy': ('PRIORITY_QUEUE', {})} db_host = 'localhost' db_database = 'WebLabTests' core_universal_identifier = 'da2579d6-e3b2-11e0-a66a-00216a5807c8' core_universal_identifier_human = 'server X at Sample University' core_server_url = 'http://localhost/weblab/'
# DomirScire def get_final_line(filename): final_line = '' for current_line in open(filename): final_line = current_line return final_line if __name__ == "__main__": print(get_final_line('./'))
def get_final_line(filename): final_line = '' for current_line in open(filename): final_line = current_line return final_line if __name__ == '__main__': print(get_final_line('./'))
class MockArgs(object): """Mock for command line args.""" def __init__(self, **kwargs): self.doctype = kwargs.get('doctype') self.output = kwargs.get('output') self.path = kwargs.get('path') class NameOptions(object): """Mock of configurable names.""" def __init__(self): self.characters = [] self.places = [] self.things = [] self.invalid = [] class MockOptions(object): """Mock of options parsed from config.""" def __init__(self): self.names = NameOptions()
class Mockargs(object): """Mock for command line args.""" def __init__(self, **kwargs): self.doctype = kwargs.get('doctype') self.output = kwargs.get('output') self.path = kwargs.get('path') class Nameoptions(object): """Mock of configurable names.""" def __init__(self): self.characters = [] self.places = [] self.things = [] self.invalid = [] class Mockoptions(object): """Mock of options parsed from config.""" def __init__(self): self.names = name_options()
class Solution(object): def sortColors(self, nums): """ :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """ if not nums: return None redcount=0 whilecount=0 bluecount=0 for num in nums: if num==0: redcount+=1 elif num==1: whilecount+=1 else: bluecount+=1 # set the nums for i in xrange(redcount): nums[i]=0 for i in xrange(redcount,redcount+whilecount): nums[i]=1 for i in xrange(redcount+whilecount,redcount+whilecount+bluecount): nums[i]=2
class Solution(object): def sort_colors(self, nums): """ :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """ if not nums: return None redcount = 0 whilecount = 0 bluecount = 0 for num in nums: if num == 0: redcount += 1 elif num == 1: whilecount += 1 else: bluecount += 1 for i in xrange(redcount): nums[i] = 0 for i in xrange(redcount, redcount + whilecount): nums[i] = 1 for i in xrange(redcount + whilecount, redcount + whilecount + bluecount): nums[i] = 2
class Solution: def makeString(self, s: str) -> str: result = [] for c in s: if c != '#': result.append(c) elif len(result) > 0: result.pop() return str(result) def backspaceCompare(self, s: str, t: str) -> bool: return self.makeString(s) == self.makeString(t) s = Solution() print(s.backspaceCompare("ab#c", "ad#c")) print(s.backspaceCompare("ab##", "c#d#")) print(s.backspaceCompare("a##c", "#a#c")) print(s.backspaceCompare("a#c", "b"))
class Solution: def make_string(self, s: str) -> str: result = [] for c in s: if c != '#': result.append(c) elif len(result) > 0: result.pop() return str(result) def backspace_compare(self, s: str, t: str) -> bool: return self.makeString(s) == self.makeString(t) s = solution() print(s.backspaceCompare('ab#c', 'ad#c')) print(s.backspaceCompare('ab##', 'c#d#')) print(s.backspaceCompare('a##c', '#a#c')) print(s.backspaceCompare('a#c', 'b'))
# Get frequencies of attributes def get_frequencies(plant_dict): frequencies = {} # First keep count of how many times an attribute appears count = 0 # Keep track of the number of plants for plant in plant_dict: plant_attributes = set() # Don't count duplicate attributes (such as a flower having 2 colors) plant_tuples = plant_dict[plant] for tup in plant_tuples: attribute = tup[0] if attribute in plant_attributes: continue if attribute not in frequencies: frequencies[attribute] = 1 else: frequencies[attribute] += 1 plant_attributes.add(attribute) count += 1 # Then divide by count to get a percentage for attribute in frequencies: frequencies[attribute] /= float(count)/100 return frequencies # Nicely print the attribute frequencies def print_frequencies(frequencies): for k, v in frequencies.items(): print("{}: {}%".format(k, str(v))) # Print the attributes for each plant def print_attributes(plant_dict): for plant in plant_dict: print("{} has the following features:".format(plant)) for t in plant_dict[plant]: print(t) print('')
def get_frequencies(plant_dict): frequencies = {} count = 0 for plant in plant_dict: plant_attributes = set() plant_tuples = plant_dict[plant] for tup in plant_tuples: attribute = tup[0] if attribute in plant_attributes: continue if attribute not in frequencies: frequencies[attribute] = 1 else: frequencies[attribute] += 1 plant_attributes.add(attribute) count += 1 for attribute in frequencies: frequencies[attribute] /= float(count) / 100 return frequencies def print_frequencies(frequencies): for (k, v) in frequencies.items(): print('{}: {}%'.format(k, str(v))) def print_attributes(plant_dict): for plant in plant_dict: print('{} has the following features:'.format(plant)) for t in plant_dict[plant]: print(t) print('')
squares = [] for value in range(1,11): squares.append(value **2) print(squares) digits = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] print(min(digits)) print(max(digits)) print(sum(digits)) squares = [value**2 for value in range(1,11)] print(squares) odd_numbers = list(range(1,20,1)) print(odd_numbers) cars = ['audi', 'bmw', 'subaru', 'toyota'] for car in cars: if car == 'bmw': print(car.upper()) else: print(car.title())
squares = [] for value in range(1, 11): squares.append(value ** 2) print(squares) digits = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] print(min(digits)) print(max(digits)) print(sum(digits)) squares = [value ** 2 for value in range(1, 11)] print(squares) odd_numbers = list(range(1, 20, 1)) print(odd_numbers) cars = ['audi', 'bmw', 'subaru', 'toyota'] for car in cars: if car == 'bmw': print(car.upper()) else: print(car.title())
# Stub only, D support was broken with Python2.6 and unnecessary to Nuitka def generate(env): return def exists(env): return False
def generate(env): return def exists(env): return False
class Base: def __init__(self, x=0): self.x = x class Slave(Base): def __init__(self, x): super(Slave, self).__init__() self.x = x s1 = Slave(x=2) print(s1.x)
class Base: def __init__(self, x=0): self.x = x class Slave(Base): def __init__(self, x): super(Slave, self).__init__() self.x = x s1 = slave(x=2) print(s1.x)
def strStr(haystack: str, needle: str) -> int: i = 0 j = 0 len1 = len(haystack) len2 = len(needle) while i < len1 and j < len2: if haystack[i] == needle[j]: i += 1 j += 1 else: i = i - (j - 1) j = 0 if j == len2: return i-j else: return -1 print(strStr("abcdeabc", "bcd"))
def str_str(haystack: str, needle: str) -> int: i = 0 j = 0 len1 = len(haystack) len2 = len(needle) while i < len1 and j < len2: if haystack[i] == needle[j]: i += 1 j += 1 else: i = i - (j - 1) j = 0 if j == len2: return i - j else: return -1 print(str_str('abcdeabc', 'bcd'))
#!/usr/bin/env python3 # coding:utf-8 def getCommonDivisor(m, d): while d: m, d = d, m%d return m def calc(m, d): if d == 0: return "X -- ZeroDivisionError" elif m == 0: return '0' elif m == d: return '1' com_div = getCommonDivisor(m, d) return str(m//com_div) + '/' + str(d//com_div) def myAdd(a, b, c, d): """ a/b + c/d """ molecule = a*d + b*c denominator = b*d return calc(molecule, denominator) def myMinus(a, b, c, d): """ a/b - c/d """ molecule = a*d - b*c denominator = b*d return calc(molecule, denominator) if __name__ == "__main__": print("1/2 + 1/3 =", myAdd(1, 2, 1, 3)) print("1/2 + 1/0 =", myAdd(1, 2, 1, 0)) print("1/2 + 1/2 =", myAdd(1, 2, 1, 2)) print("1/2 - 1/3 =", myMinus(1, 2, 1, 3))
def get_common_divisor(m, d): while d: (m, d) = (d, m % d) return m def calc(m, d): if d == 0: return 'X -- ZeroDivisionError' elif m == 0: return '0' elif m == d: return '1' com_div = get_common_divisor(m, d) return str(m // com_div) + '/' + str(d // com_div) def my_add(a, b, c, d): """ a/b + c/d """ molecule = a * d + b * c denominator = b * d return calc(molecule, denominator) def my_minus(a, b, c, d): """ a/b - c/d """ molecule = a * d - b * c denominator = b * d return calc(molecule, denominator) if __name__ == '__main__': print('1/2 + 1/3 =', my_add(1, 2, 1, 3)) print('1/2 + 1/0 =', my_add(1, 2, 1, 0)) print('1/2 + 1/2 =', my_add(1, 2, 1, 2)) print('1/2 - 1/3 =', my_minus(1, 2, 1, 3))
''' Program to count number of trees in a forest. Approach: The idea is to apply Depth First Search on every node. If every connected node is visited from one source then increment count by one. If some nodes yet not visited again perform DFS traversal. Return the count. Example: Input : edges[] = {0, 1}, {0, 2}, {3, 4} Output : 2 Explanation : There are 2 trees 0 3 / \ \ 1 2 4 Input : edges[] = {0, 1}, {0, 2}, {3, 4}, {5, 6} Output : 3 Explanation : There are 3 trees 0 3 5 / \ \ \ 1 2 4 6 ''' def Insert_Edge(Graph, u, v): Graph[u].append(v) Graph[v].append(u) def Depth_First_Search_Traversal(u, Graph, Check_visited): Check_visited[u] = True for i in range(len(Graph[u])): if (Check_visited[Graph[u][i]] == False): Depth_First_Search_Traversal(Graph[u][i], Graph, Check_visited) def Count_Tree(Graph, V): Check_visited = [False] * V res = 0 for u in range(V): if (Check_visited[u] == False): Depth_First_Search_Traversal(u, Graph, Check_visited) res += 1 return res # Driver code if __name__ == '__main__': V = 7 Graph = [[] for i in range(V)] Insert_Edge(Graph, 0, 1) Insert_Edge(Graph, 0, 2) Insert_Edge(Graph, 3, 4) Insert_Edge(Graph, 5, 6) print(Count_Tree(Graph, V))
""" Program to count number of trees in a forest. Approach: The idea is to apply Depth First Search on every node. If every connected node is visited from one source then increment count by one. If some nodes yet not visited again perform DFS traversal. Return the count. Example: Input : edges[] = {0, 1}, {0, 2}, {3, 4} Output : 2 Explanation : There are 2 trees 0 3 / \\ 1 2 4 Input : edges[] = {0, 1}, {0, 2}, {3, 4}, {5, 6} Output : 3 Explanation : There are 3 trees 0 3 5 / \\ \\ 1 2 4 6 """ def insert__edge(Graph, u, v): Graph[u].append(v) Graph[v].append(u) def depth__first__search__traversal(u, Graph, Check_visited): Check_visited[u] = True for i in range(len(Graph[u])): if Check_visited[Graph[u][i]] == False: depth__first__search__traversal(Graph[u][i], Graph, Check_visited) def count__tree(Graph, V): check_visited = [False] * V res = 0 for u in range(V): if Check_visited[u] == False: depth__first__search__traversal(u, Graph, Check_visited) res += 1 return res if __name__ == '__main__': v = 7 graph = [[] for i in range(V)] insert__edge(Graph, 0, 1) insert__edge(Graph, 0, 2) insert__edge(Graph, 3, 4) insert__edge(Graph, 5, 6) print(count__tree(Graph, V))
def reverseInput(word): # str[start:stop:step] return word[::-1] def reverseInput2(word): new_word = "" for char in word: new_word = char + new_word return new_word if __name__ == "__main__": word = input("Enter the word: ") print(reverseInput(word)) print(reverseInput2(word))
def reverse_input(word): return word[::-1] def reverse_input2(word): new_word = '' for char in word: new_word = char + new_word return new_word if __name__ == '__main__': word = input('Enter the word: ') print(reverse_input(word)) print(reverse_input2(word))
''' In a N x N grid representing a field of cherries, each cell is one of three possible integers. 0 means the cell is empty, so you can pass through; 1 means the cell contains a cherry, that you can pick up and pass through; -1 means the cell contains a thorn that blocks your way. Your task is to collect maximum number of cherries possible by following the rules below: Starting at the position (0, 0) and reaching (N-1, N-1) by moving right or down through valid path cells (cells with value 0 or 1); After reaching (N-1, N-1), returning to (0, 0) by moving left or up through valid path cells; When passing through a path cell containing a cherry, you pick it up and the cell becomes an empty cell (0); If there is no valid path between (0, 0) and (N-1, N-1), then no cherries can be collected. Example 1: Input: grid = [[0, 1, -1], [1, 0, -1], [1, 1, 1]] Output: 5 Explanation: The player started at (0, 0) and went down, down, right right to reach (2, 2). 4 cherries were picked up during this single trip, and the matrix becomes [[0,1,-1],[0,0,-1],[0,0,0]]. Then, the player went left, up, up, left to return home, picking up one more cherry. The total number of cherries picked up is 5, and this is the maximum possible. Note: grid is an N by N 2D array, with 1 <= N <= 50. Each grid[i][j] is an integer in the set {-1, 0, 1}. It is guaranteed that grid[0][0] and grid[N-1][N-1] are not -1. ''' class Solution(object): def cherryPickup(self, grid): """ :type grid: List[List[int]] :rtype: int """ if not grid or not grid[0]: return 0 f = [[[float('-inf') for rowb in xrange(len(grid))] for rowa in xrange(len(grid))] for k in xrange(len(grid) + len(grid[0]) - 1)] if grid[0][0] >= 0: f[0][0][0] = grid[0][0] for k in xrange(1, len(grid) + len(grid[0]) - 1): for rowa in xrange(len(grid)): cola = k - rowa if cola < 0 or len(grid[0]) <= cola or grid[rowa][cola] == -1: continue for rowb in xrange(len(grid)): colb = k - rowb if colb < 0 or len(grid[0]) <= colb or grid[rowb][colb] == -1: continue if 0 <= rowa - 1 and 0 <= rowb - 1: f[k][rowa][rowb] = max(f[k][rowa][rowb], f[k-1][rowa-1][rowb-1]) if 0 <= rowa - 1 and 0 <= colb - 1: f[k][rowa][rowb] = max(f[k][rowa][rowb], f[k-1][rowa-1][rowb]) if 0 <= cola - 1 and 0 <= rowb - 1: f[k][rowa][rowb] = max(f[k][rowa][rowb], f[k-1][rowa][rowb-1]) if 0 <= cola - 1 and 0 <= colb - 1: f[k][rowa][rowb] = max(f[k][rowa][rowb], f[k-1][rowa][rowb]) if rowa == rowb: f[k][rowa][rowb] += grid[rowa][cola] else: f[k][rowa][rowb] += grid[rowa][cola] + grid[rowb][colb] return max(0, f[-1][-1][-1])
""" In a N x N grid representing a field of cherries, each cell is one of three possible integers. 0 means the cell is empty, so you can pass through; 1 means the cell contains a cherry, that you can pick up and pass through; -1 means the cell contains a thorn that blocks your way. Your task is to collect maximum number of cherries possible by following the rules below: Starting at the position (0, 0) and reaching (N-1, N-1) by moving right or down through valid path cells (cells with value 0 or 1); After reaching (N-1, N-1), returning to (0, 0) by moving left or up through valid path cells; When passing through a path cell containing a cherry, you pick it up and the cell becomes an empty cell (0); If there is no valid path between (0, 0) and (N-1, N-1), then no cherries can be collected. Example 1: Input: grid = [[0, 1, -1], [1, 0, -1], [1, 1, 1]] Output: 5 Explanation: The player started at (0, 0) and went down, down, right right to reach (2, 2). 4 cherries were picked up during this single trip, and the matrix becomes [[0,1,-1],[0,0,-1],[0,0,0]]. Then, the player went left, up, up, left to return home, picking up one more cherry. The total number of cherries picked up is 5, and this is the maximum possible. Note: grid is an N by N 2D array, with 1 <= N <= 50. Each grid[i][j] is an integer in the set {-1, 0, 1}. It is guaranteed that grid[0][0] and grid[N-1][N-1] are not -1. """ class Solution(object): def cherry_pickup(self, grid): """ :type grid: List[List[int]] :rtype: int """ if not grid or not grid[0]: return 0 f = [[[float('-inf') for rowb in xrange(len(grid))] for rowa in xrange(len(grid))] for k in xrange(len(grid) + len(grid[0]) - 1)] if grid[0][0] >= 0: f[0][0][0] = grid[0][0] for k in xrange(1, len(grid) + len(grid[0]) - 1): for rowa in xrange(len(grid)): cola = k - rowa if cola < 0 or len(grid[0]) <= cola or grid[rowa][cola] == -1: continue for rowb in xrange(len(grid)): colb = k - rowb if colb < 0 or len(grid[0]) <= colb or grid[rowb][colb] == -1: continue if 0 <= rowa - 1 and 0 <= rowb - 1: f[k][rowa][rowb] = max(f[k][rowa][rowb], f[k - 1][rowa - 1][rowb - 1]) if 0 <= rowa - 1 and 0 <= colb - 1: f[k][rowa][rowb] = max(f[k][rowa][rowb], f[k - 1][rowa - 1][rowb]) if 0 <= cola - 1 and 0 <= rowb - 1: f[k][rowa][rowb] = max(f[k][rowa][rowb], f[k - 1][rowa][rowb - 1]) if 0 <= cola - 1 and 0 <= colb - 1: f[k][rowa][rowb] = max(f[k][rowa][rowb], f[k - 1][rowa][rowb]) if rowa == rowb: f[k][rowa][rowb] += grid[rowa][cola] else: f[k][rowa][rowb] += grid[rowa][cola] + grid[rowb][colb] return max(0, f[-1][-1][-1])
EXAMPLE = '''\ |+1|-1|+2|-2|+3|-3|+sg|+pl|-sg|-pl| 1sg| X| | | X| | X| X| | | X| 1pl| X| | | X| | X| | X| X| | 2sg| | X| X| | | X| X| | | X| 2pl| | X| X| | | X| | X| X| | 3sg| | X| | X| X| | X| | | X| 3pl| | X| | X| X| | | X| X| | '''
example = ' |+1|-1|+2|-2|+3|-3|+sg|+pl|-sg|-pl|\n1sg| X| | | X| | X| X| | | X|\n1pl| X| | | X| | X| | X| X| |\n2sg| | X| X| | | X| X| | | X|\n2pl| | X| X| | | X| | X| X| |\n3sg| | X| | X| X| | X| | | X|\n3pl| | X| | X| X| | | X| X| |\n'
class Solution: def intToRoman(self, num): """ :type num: int :rtype: str """ roman = 'MDCLXVI' romandiv = [1000, 500, 100, 50, 10, 5, 1] ans = '' strnum = str(num) i = 6 - (len(strnum) - 1) * 2 for c in strnum: if c == '1': ans += roman[i] elif c == '2': ans += roman[i] * 2 elif c == '3': ans += roman[i] * 3 elif c == '4': ans += roman[i] + roman[i - 1] elif c == '5': ans += roman[i - 1] elif c == '6': ans += roman[i - 1] + roman[i] elif c == '7': ans += roman[i - 1] + roman[i] * 2 elif c == '8': ans += roman[i - 1] + roman[i] * 3 elif c == '9': ans += roman[i] + roman[i - 2] i += 2 return ans if __name__ == "__main__": solution = Solution() print(solution.intToRoman(3)) print(solution.intToRoman(4)) print(solution.intToRoman(9)) print(solution.intToRoman(58)) print(solution.intToRoman(1994))
class Solution: def int_to_roman(self, num): """ :type num: int :rtype: str """ roman = 'MDCLXVI' romandiv = [1000, 500, 100, 50, 10, 5, 1] ans = '' strnum = str(num) i = 6 - (len(strnum) - 1) * 2 for c in strnum: if c == '1': ans += roman[i] elif c == '2': ans += roman[i] * 2 elif c == '3': ans += roman[i] * 3 elif c == '4': ans += roman[i] + roman[i - 1] elif c == '5': ans += roman[i - 1] elif c == '6': ans += roman[i - 1] + roman[i] elif c == '7': ans += roman[i - 1] + roman[i] * 2 elif c == '8': ans += roman[i - 1] + roman[i] * 3 elif c == '9': ans += roman[i] + roman[i - 2] i += 2 return ans if __name__ == '__main__': solution = solution() print(solution.intToRoman(3)) print(solution.intToRoman(4)) print(solution.intToRoman(9)) print(solution.intToRoman(58)) print(solution.intToRoman(1994))
def is_valid_row_col(next_r, next_c): if 0 <= next_r < 8 and 0 <= next_c < 8: return True return False matrix = [] queens = [] for _ in range(8): data = input().split(" ") matrix.append(data) row_king = int col_king = int for row in range(8): for column in range(8): if matrix[row][column] == "K": row_king = row col_king = column rotations = { "up": (-1, 0), "down": (1, 0), "left": (0, -1), "right": (0, 1), "up_left": (-1, -1), "up_right": (-1, 1), "down_left": (1, -1), "down_right": (1, 1) } for rotation in rotations: next_row = row_king + rotations[rotation][0] next_col = col_king + rotations[rotation][1] while is_valid_row_col(next_row, next_col): if matrix[next_row][next_col] == "Q": queens.append([next_row, next_col]) break next_row += rotations[rotation][0] next_col += rotations[rotation][1] if queens: [print(q) for q in queens] else: print("The king is safe!")
def is_valid_row_col(next_r, next_c): if 0 <= next_r < 8 and 0 <= next_c < 8: return True return False matrix = [] queens = [] for _ in range(8): data = input().split(' ') matrix.append(data) row_king = int col_king = int for row in range(8): for column in range(8): if matrix[row][column] == 'K': row_king = row col_king = column rotations = {'up': (-1, 0), 'down': (1, 0), 'left': (0, -1), 'right': (0, 1), 'up_left': (-1, -1), 'up_right': (-1, 1), 'down_left': (1, -1), 'down_right': (1, 1)} for rotation in rotations: next_row = row_king + rotations[rotation][0] next_col = col_king + rotations[rotation][1] while is_valid_row_col(next_row, next_col): if matrix[next_row][next_col] == 'Q': queens.append([next_row, next_col]) break next_row += rotations[rotation][0] next_col += rotations[rotation][1] if queens: [print(q) for q in queens] else: print('The king is safe!')
# O(n) time and O(log n) space def max_path_sum(tree): _, max_path_sum = max_path_sum_helper(tree) return max_path_sum def max_path_sum_helper(tree): if not tree: # Base case of not a node return (0, 0) # Depth first bottom up approach to calculate the max path sum left_branch_sum, left_triangle_sum = max_path_sum_helper(tree.left) right_branch_sum, right_triangle_sum = max_path_sum_helper(tree.right) # Using node label instead of tree seems to be more appropriate node_value = tree.value # The max between left or right child_branch_sum = max(left_branch_sum, right_branch_sum) # The max from either node, node + left, or node + right node_child_sum = max(node_value + child_branch_sum, node_value) # The max sum may comes a triangle (left - Node - right) # or either node or node - left or node - right triangle_sum = max(node_child_sum, left_branch_sum + node_value + right_branch_sum) # Only one triangle is allowed since maximum connection between a node is two. # Since the maximum path sum can only exist one triangle being formed, then # the triangle might come from the current node triangle, left triangle, or right triangle. max_path_sum = max(triangle_sum, left_triangle_sum, right_triangle_sum) # Returns to the parent node in order to compute a valid path to avoid multiple triangles. # That is, return (max sum that does not form a triangle, max sum possibly formed by a triangle) return node_child_sum, max_path_sum
def max_path_sum(tree): (_, max_path_sum) = max_path_sum_helper(tree) return max_path_sum def max_path_sum_helper(tree): if not tree: return (0, 0) (left_branch_sum, left_triangle_sum) = max_path_sum_helper(tree.left) (right_branch_sum, right_triangle_sum) = max_path_sum_helper(tree.right) node_value = tree.value child_branch_sum = max(left_branch_sum, right_branch_sum) node_child_sum = max(node_value + child_branch_sum, node_value) triangle_sum = max(node_child_sum, left_branch_sum + node_value + right_branch_sum) max_path_sum = max(triangle_sum, left_triangle_sum, right_triangle_sum) return (node_child_sum, max_path_sum)
""" Mouse Press. Saves one PDF of the contents of the display window each time the mouse is pressed. """ add_library('pdf') saveOneFrame = False def setup(): size(600, 600) frameRate(24) def draw(): global saveOneFrame if saveOneFrame: beginRecord(PDF, "Line.pdf") background(255) stroke(0, 20) strokeWeight(20.0) line(mouseX, 0, width - mouseY, height) if saveOneFrame: endRecord() saveOneFrame = False def mousePressed(): global saveOneFrame saveOneFrame = True
""" Mouse Press. Saves one PDF of the contents of the display window each time the mouse is pressed. """ add_library('pdf') save_one_frame = False def setup(): size(600, 600) frame_rate(24) def draw(): global saveOneFrame if saveOneFrame: begin_record(PDF, 'Line.pdf') background(255) stroke(0, 20) stroke_weight(20.0) line(mouseX, 0, width - mouseY, height) if saveOneFrame: end_record() save_one_frame = False def mouse_pressed(): global saveOneFrame save_one_frame = True
# # PySNMP MIB module SW-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SW-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:36:37 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint") fcSwitch, bcsiModules = mibBuilder.importSymbols("Brocade-REG-MIB", "fcSwitch", "bcsiModules") SwTrunkMaster, SwSensorIndex, SwDomainIndex, FcWwn, SwNbIndex, SwPortIndex = mibBuilder.importSymbols("Brocade-TC", "SwTrunkMaster", "SwSensorIndex", "SwDomainIndex", "FcWwn", "SwNbIndex", "SwPortIndex") connUnitPortEntry, connUnitPortStatEntry = mibBuilder.importSymbols("FCMGMT-MIB", "connUnitPortEntry", "connUnitPortStatEntry") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Bits, Unsigned32, Integer32, ModuleIdentity, NotificationType, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, iso, TimeTicks, MibIdentifier, Counter64, Gauge32, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Unsigned32", "Integer32", "ModuleIdentity", "NotificationType", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "iso", "TimeTicks", "MibIdentifier", "Counter64", "Gauge32", "ObjectIdentity") TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "TruthValue") swMibModule = ModuleIdentity((1, 3, 6, 1, 4, 1, 1588, 3, 1, 3)) swMibModule.setRevisions(('2003-01-13 14:30', '2003-07-20 14:30', '2004-04-15 10:30', '2004-08-06 18:30', '2005-04-29 20:16', '2006-01-09 09:00', '2006-05-17 09:00', '2007-01-23 09:00', '2007-06-08 12:00', '2007-06-27 10:30', '2007-08-01 12:20', '2007-08-29 04:42', '2008-01-29 07:59', '2008-07-17 03:45', '2008-07-24 02:32', '2008-07-25 02:32', '2008-09-09 09:00', '2009-09-28 09:00', '2009-02-21 09:00', '2009-03-30 09:00', '2009-06-25 12:00', '2009-06-29 01:00', '2009-06-30 13:06', '2009-06-30 06:00', '2009-10-30 05:00', '2009-11-03 13:06', '2009-11-05 12:00', '2009-11-05 05:00', '2009-11-06 11:30', '2009-11-30 10:30', '2009-12-03 17:30', '2010-01-30 17:30', '2010-07-08 11:30', '2010-07-15 11:30', '2010-07-21 11:30', '2010-08-06 11:30', '2010-08-20 10:30', '2010-10-07 10:30', '2010-10-09 10:30', '2010-10-25 10:30', '2010-11-01 06:00', '2010-11-02 10:30', '2010-12-02 10:30', '2010-12-08 10:30', '2010-12-20 10:00', '2010-12-21 04:00', '2010-12-22 10:00', '2010-12-30 10:00', '2011-01-06 10:30', '2011-01-07 10:30', '2011-02-18 06:00', '2012-02-23 10:30', '2012-03-05 03:33', '2012-05-15 14:25', '2012-06-04 17:20', '2012-06-14 10:00', '2012-06-29 15:20', '2012-07-10 16:00', '2012-09-26 14:00', '2013-03-21 13:00', '2013-04-04 17:48', '2013-04-22 11:30', '2013-04-25 18:03', '2013-05-15 14:30', '2013-06-05 16:00', '2013-06-29 10:00', '2013-09-12 10:00', '2013-10-04 13:40',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: swMibModule.setRevisionsDescriptions(('The initial version of this module.', 'Added swIDIDMode to the swFabric group.', 'Added object for Trap Severity Level, swFwLastSeverityLevel. Added the enumeration swFwResourceFlash for SwFwClassesAreas. Deprecated the mib object swEventTrapLevel. Updated the description of swGroupId and corrected the spell mistakes. Obsoleted the swFault Trap. Added enumerations four-GB for swFCPortSpeed and unknown, other for swFCPortType.', 'Added swFCPortSpecifier object to swFCPortTable.', 'Modified the #SUMMARY and #ARGUMENTS for swFabricWatchTrap', '1. Modified the description for swPortTrunked 2. Updated the SW Traps summary and description to remove the obsolete varbindings', 'Added swFCPortFlag object to swFCPortTable', 'Added enumerations eight-GB and ten-GB for swFCPortSpeed', 'Included swFCPortFlag as an additiional variable binding for trap SWFCPortScn', 'Added enumerations octuple and decuple for swNbBaudRate', 'Added the enumerations swFwEPortUtil and swFwEPortPktl for swFwClassAreaIndex', 'Added swFCPortBrcdType object to swFCPortTable', 'Added Toptalker support and swVfId to the swFabric group.', 'Added swIPv6ChangeTrap, swIPv6Address and swIPv6Status .', 'Added swModel to distiguish between 7500 and 7500E switch .', 'Added the enumerations swFwPortLr, swFwEPortLr, swFwEPortUtil, swFwEPortPktl, swFwFCUPortLr, swFwFOPPortLr for swFwClassAreaIndex.', 'Added swPmgrEventTrap information.', 'Added additional fabric watch threshold in SwFwActs.', 'Added port phy states.', 'Added swEventVfId in swEventTable.', "Removed the version information from Brocade's proprietary MIB file name.", 'Modified swVfid position at the last of swFabric table', 'Added swFwCPUMemUsage enumeration under swFwClassAreaIndex.', 'Updated the description of swCpuAction/swMemAction and access of swcpuormemoryusage objects and changed the type of swEndDeviceInvalidWord, swEndDeviceLinkFailure,swEndDeviceSyncLoss, swEndDeviceSigLoss, swEndDeviceProtoErr,swEndDeviceInvalidCRC from integer32 to counter32.', 'Added swFabricReconfigTrap and swFabricSegmentTrap.', 'Removed enum switchReboot from swAdmStatus.', 'Changed swFwCustUnit access to read-only', 'Added enums swFwEPortTrunkUtil,swFwFCUPortTrunkUtil and swFwFOPPortTrunkUtil in SwFwClassesAreas', 'Added swConnUnitExtensionTable and entries for 64 bit portstats.', 'Added swMemUsageLimit1 and swMemUsageLimit3 under swCpuOrMemoryUsage', 'Added swExttrap as internal trap.', 'Changed the descriptions for swConnUnitExtensionTable.', 'Obsoleted swGroupTable, swGroupMemTable from swGroup.', 'Added swFCPortWwn, swFCPortBrcdType in swFcPortScn and added swStateChangeTrap', 'Added trap swPortMoveTrap', 'Added trap portStats objects under SwConnUnitPortStatEntry', 'Added trap swBrcdGenericTrap', 'Added swVfName', 'Added swPortConfigTable', 'Added swFCPortPrevType in swFCPortScn', 'Added fifty filter classes under swFwClassAreaIndex', 'Updated the description of swBrcdTrapBitMask and swBrcdGenericTrap for Fapwwn Trap', 'Deprecated swAgtCmtyTable and provided support of standard mibs SnmpCommunityTable and snmpTargetParamsTable and snmpTargetAddrTable', 'Updated the datatype for swPortEncrypt and swPortCompression', 'Added enumeration sexdecuple for swNbBaudRate', 'Added a new value lowBufferCrsd(7) for swFwLastEvent', 'Changed the area name filter-fmcfg to filterFmCfg in SwFwClassesAreas', 'Included FDMI event case in swBrcdTrapBitMask', 'Added class3 discards error in SwConnUnitPortStatEntry', 'Moved swPortConfigTable, CiperMode and Encrypt/CompressStatus to faext.mib', 'Changed fportmode(2) to portmode(2) for object swTopTalkerMntMode.', 'Added swauthProtocolPassword and swauthProtocolPassword for IBM DirectorServer applications', 'Added new enum noSigDet(14) for object swFCPortPhyState', 'Changed the syntax of swCpuAction and swMemAction objects.', 'Added PCS block errors in swConnUnitPortStatEntry', 'Added swDeviceStatus and swDeviceStatusTrap', 'Added sixteenGB support to swFCPortSpeed and also deprecated teh same', 'Added an area filterFmCfg51 in the class SwFwClassesAreas', 'Removed the tab space and added the space key for swFCPortEntry 38 as this caused a crash in MIB browser', 'Added swFCPortDisableReason in SwFCPortEntry and swFCPortScn trap.', 'Added unroutable frame counter in swConnUnitPortStatEntry', 'Made the swFCPortSpeed obsolete', 'Changed the description for swVFName and swConnUnitPCSErrorCounter', 'Updated swFCPortCapacity description', 'Added swFwPowerOnHours in SwFwClassesAreas', 'Updated the description for swCpuUsageLimit, swCpuAction, swMemAction, swMemUsageLimit1 and swMemUsageLimit3.', 'Added FEC Counters swConnUnitFECCorrectedCounter, swConnUnitFECUnCorrectedCounter', 'Added swZoneConfigChangeTrap',)) if mibBuilder.loadTexts: swMibModule.setLastUpdated('201310041340Z') if mibBuilder.loadTexts: swMibModule.setOrganization('Brocade Communications Systems, Inc.,') if mibBuilder.loadTexts: swMibModule.setContactInfo('Customer Support Group Brocade Communications Systems, 1745 Technology Drive, San Jose, CA 95110 U.S.A Tel: +1-408-392-6061 Fax: +1-408-392-6656 Email: support@Brocade.COM WEB: www.brocade.com') if mibBuilder.loadTexts: swMibModule.setDescription("The MIB module is for Brocade's Fibre Channel Switch. Copyright (c) 1996-2003 Brocade Communications Systems, Inc. All rights reserved.") sw = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1)) if mibBuilder.loadTexts: sw.setStatus('current') if mibBuilder.loadTexts: sw.setDescription("The OID sub-tree for Brocade's Silkworm Series of Fibre Channel Switches.") sw28k = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 2)) if mibBuilder.loadTexts: sw28k.setStatus('current') if mibBuilder.loadTexts: sw28k.setDescription("The OID for Brocade's Silkworm 2800 model Fibre Channel Switch.") sw21kN24k = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 3)) if mibBuilder.loadTexts: sw21kN24k.setStatus('current') if mibBuilder.loadTexts: sw21kN24k.setDescription("The OID for Brocade's Silkworm 2100 and 2400 series model Fibre Channel Switch.") sw20x0 = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 4)) if mibBuilder.loadTexts: sw20x0.setStatus('current') if mibBuilder.loadTexts: sw20x0.setDescription("The OID for Brocade's Silkworm 20x0 series model Fibre Channel Switch.") class SwSevType(TextualConvention, Integer32): description = "The event trap level in conjunction with the an event's severity level." status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5)) namedValues = NamedValues(("none", 0), ("critical", 1), ("error", 2), ("warning", 3), ("informational", 4), ("debug", 5)) class FcPortFlag(TextualConvention, Bits): description = 'Represents the port status for a FC Flag. Currently this will indicate if the port is virtual or physical.' status = 'current' namedValues = NamedValues(("physical", 0), ("virtual", 1)) swSystem = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1)) if mibBuilder.loadTexts: swSystem.setStatus('current') if mibBuilder.loadTexts: swSystem.setDescription('The OID sub-tree for swSystem group.') swFabric = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2)) if mibBuilder.loadTexts: swFabric.setStatus('current') if mibBuilder.loadTexts: swFabric.setDescription('The OID sub-tree for swFabric group.') swModule = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 3)) if mibBuilder.loadTexts: swModule.setStatus('current') if mibBuilder.loadTexts: swModule.setDescription('The OID sub-tree for swModule group.') swAgtCfg = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4)) if mibBuilder.loadTexts: swAgtCfg.setStatus('current') if mibBuilder.loadTexts: swAgtCfg.setDescription('The OID sub-tree for swAgtCfg group.') swFCport = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6)) if mibBuilder.loadTexts: swFCport.setStatus('current') if mibBuilder.loadTexts: swFCport.setDescription('The OID sub-tree for swFCport group.') swNs = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7)) if mibBuilder.loadTexts: swNs.setStatus('current') if mibBuilder.loadTexts: swNs.setDescription('The OID sub-tree for swNs group.') swEvent = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8)) if mibBuilder.loadTexts: swEvent.setStatus('current') if mibBuilder.loadTexts: swEvent.setDescription('The OID sub-tree for swEvent group.') swFwSystem = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10)) if mibBuilder.loadTexts: swFwSystem.setStatus('current') if mibBuilder.loadTexts: swFwSystem.setDescription('The OID sub-tree for swFwSystem group.') swEndDevice = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21)) if mibBuilder.loadTexts: swEndDevice.setStatus('current') if mibBuilder.loadTexts: swEndDevice.setDescription('The OID sub-tree for swEndDevice group.') swGroup = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22)) if mibBuilder.loadTexts: swGroup.setStatus('obsolete') if mibBuilder.loadTexts: swGroup.setDescription('The OID sub-tree for swGroup group.') swBlmPerfMnt = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23)) if mibBuilder.loadTexts: swBlmPerfMnt.setStatus('current') if mibBuilder.loadTexts: swBlmPerfMnt.setDescription('The OID sub-tree for swBlmPerfMnt (Bloom Performance Monitor) group.') swTrunk = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24)) if mibBuilder.loadTexts: swTrunk.setStatus('current') if mibBuilder.loadTexts: swTrunk.setDescription('The OID sub-tree for swTrunk group.') swTopTalker = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25)) if mibBuilder.loadTexts: swTopTalker.setStatus('current') if mibBuilder.loadTexts: swTopTalker.setDescription('The OID sub-tree for TopTalker group.') swCpuOrMemoryUsage = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26)) if mibBuilder.loadTexts: swCpuOrMemoryUsage.setStatus('current') if mibBuilder.loadTexts: swCpuOrMemoryUsage.setDescription('The OID sub-tree for cpu or memory usage group.') swConnUnitPortStatExtentionTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27), ) if mibBuilder.loadTexts: swConnUnitPortStatExtentionTable.setStatus('current') if mibBuilder.loadTexts: swConnUnitPortStatExtentionTable.setDescription('This represents the Conn unit Port Stats') swCurrentDate = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: swCurrentDate.setStatus('current') if mibBuilder.loadTexts: swCurrentDate.setDescription('The current date information in displayable textual format.') swBootDate = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: swBootDate.setStatus('current') if mibBuilder.loadTexts: swBootDate.setDescription('The date and time when the system last booted, in displayable textual format.') swFWLastUpdated = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFWLastUpdated.setStatus('current') if mibBuilder.loadTexts: swFWLastUpdated.setDescription('The information indicates the date when the firmware was last updated, in displayable textual format.') swFlashLastUpdated = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFlashLastUpdated.setStatus('current') if mibBuilder.loadTexts: swFlashLastUpdated.setDescription('The information indicates the date when the FLASH was last updated, in displayable textual format.') swBootPromLastUpdated = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: swBootPromLastUpdated.setStatus('current') if mibBuilder.loadTexts: swBootPromLastUpdated.setDescription('The information indicates the date when the boot PROM was last updated, in displayable textual format.') swFirmwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFirmwareVersion.setStatus('current') if mibBuilder.loadTexts: swFirmwareVersion.setDescription('The current version of the firwmare.') swOperStatus = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("online", 1), ("offline", 2), ("testing", 3), ("faulty", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swOperStatus.setStatus('current') if mibBuilder.loadTexts: swOperStatus.setDescription('The current operational status of the switch. The states are as follow: o online(1) means the switch is accessible by an external Fibre Channel port; o offline(2) means the switch is not accessible; o testing(3) means the switch is in a built-in test mode and is not accessible by an external Fibre Channel port; o faulty(4) means the switch is not operational.') swAdmStatus = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("online", 1), ("offline", 2), ("testing", 3), ("faulty", 4), ("reboot", 5), ("fastboot", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swAdmStatus.setStatus('current') if mibBuilder.loadTexts: swAdmStatus.setDescription("The desired administrative status of the switch. A management station may place the switch in a desired state by setting this object accordingly. The states are as follow: o online(1) means set the switch to be accessible by an external Fibre Channel port; o offline(2) means set the switch to be inaccessible; o testing(3) means set the switch to run the built-in test; o faulty(4) means set the switch to a 'soft' faulty condition; o reboot(5) means set the switch to reboot in 1 second. o fastboot(6) means set the switch to fastboot in 1 second. Fastboot would cause the switch to boot but skip over the POST. When the switch is in faulty state, only two states can be set: faulty and reboot/fastboot.") swTelnetShellAdmStatus = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("unknown", 0), ("terminated", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swTelnetShellAdmStatus.setStatus('current') if mibBuilder.loadTexts: swTelnetShellAdmStatus.setDescription('The desired administrative status of the Telnet shell. By setting it to terminated(1), the current Telnet shell task is deleted. When this variable instance is read, it reports the value last set through SNMP.') swSsn = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: swSsn.setStatus('current') if mibBuilder.loadTexts: swSsn.setDescription('The soft serial number of the switch.') swFlashDLOperStatus = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 0), ("swCurrent", 1), ("swFwUpgraded", 2), ("swCfUploaded", 3), ("swCfDownloaded", 4), ("swFwCorrupted", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFlashDLOperStatus.setStatus('current') if mibBuilder.loadTexts: swFlashDLOperStatus.setDescription('The operational status of the FLASH. The operational states are as follow: o swCurrent(1) indicates that the FLASH contains the current firmware image or config file; o swFwUpgraded(2) state indicates that it contains the image upgraded from the swFlashDLHost.0.; o swCfUploaded(3) state indicates that the switch configuration file has been uploaded to the host; and o swCfDownloaded(4) state indicates that the switch configuration file has been downloaded from the host. o swFwCorrupted (5) state indicates that the firmware in the FLASH of the switch is corrupted.') swFlashDLAdmStatus = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("swCurrent", 1), ("swFwUpgrade", 2), ("swCfUpload", 3), ("swCfDownload", 4), ("swFwCorrupted", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFlashDLAdmStatus.setStatus('current') if mibBuilder.loadTexts: swFlashDLAdmStatus.setDescription('The desired state of the FLASH. A management station may place the FLASH in a desired state by setting this object accordingly: o swCurrent(1) indicates that the FLASH contains the current firmware image or config file; o swFwUpgrade(2) means that the firmware in the FLASH is to be upgraded from the host specified; o swCfUpload(3) means that the switch config file is to be uploaded to the host specified; or o swCfDownload(4) means that the switch config file is to be downloaded from the host specified. o swFwCorrupted(5) state indicates that the firmware in the FLASH is corrupted. This value is for informational purpose only. However, set of swFlashDLAdmStatus to this value is not allowed. The host is specified in swFlashDLHost.0. In addition, user name is specified in swFlashDLUser.0, and the file name specified in swFlashDLFile.0. Reference the user manual on the following commands, o firmwareDownload, o configUpload, and o configDownload.') swFlashDLHost = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFlashDLHost.setStatus('current') if mibBuilder.loadTexts: swFlashDLHost.setDescription('The name or IP address (in dot notation) of the host to download or upload a relevant file to the FLASH.') swFlashDLUser = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFlashDLUser.setStatus('current') if mibBuilder.loadTexts: swFlashDLUser.setDescription('The user name on the host to download or upload a relevant file to or from the FLASH.') swFlashDLFile = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 15), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFlashDLFile.setStatus('current') if mibBuilder.loadTexts: swFlashDLFile.setDescription('The name of the file to be downloaded or uploaded.') swFlashDLPassword = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 16), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFlashDLPassword.setStatus('current') if mibBuilder.loadTexts: swFlashDLPassword.setDescription('The password to be used in for FTP transfer of files in the download or upload operation.') swBeaconOperStatus = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swBeaconOperStatus.setStatus('current') if mibBuilder.loadTexts: swBeaconOperStatus.setDescription('The current operational status of the switch beacon. When the beacon is on, the LEDs on the front panel of the switch run alternately from left to right and right to left. The color is yellow. When the beacon is off, each LED will be in their its regular status indicating color and state.') swBeaconAdmStatus = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swBeaconAdmStatus.setStatus('current') if mibBuilder.loadTexts: swBeaconAdmStatus.setDescription('The desired status of the switch beacon. When the beacon is set to on, the LEDs on the front panel of the switch run alternately from left to right and right to left. The color is yellow. When the beacon is set to off, each LED will be in its regular status indicating color and state.') swDiagResult = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("sw-ok", 1), ("sw-faulty", 2), ("sw-embedded-port-fault", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swDiagResult.setStatus('current') if mibBuilder.loadTexts: swDiagResult.setDescription('The result of the power-on startup (POST) diagnostics.') swNumSensors = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swNumSensors.setStatus('current') if mibBuilder.loadTexts: swNumSensors.setDescription('The number of sensors inside the switch.') swSensorTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22), ) if mibBuilder.loadTexts: swSensorTable.setStatus('current') if mibBuilder.loadTexts: swSensorTable.setDescription('The table of sensor entries.') swSensorEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1), ).setIndexNames((0, "SW-MIB", "swSensorIndex")) if mibBuilder.loadTexts: swSensorEntry.setStatus('current') if mibBuilder.loadTexts: swSensorEntry.setDescription('An entry of the sensor information.') swSensorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1, 1), SwSensorIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swSensorIndex.setStatus('current') if mibBuilder.loadTexts: swSensorIndex.setDescription('This object identifies the sensor.') swSensorType = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("temperature", 1), ("fan", 2), ("power-supply", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swSensorType.setStatus('current') if mibBuilder.loadTexts: swSensorType.setDescription('This object identifies the sensor type.') swSensorStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("unknown", 1), ("faulty", 2), ("below-min", 3), ("nominal", 4), ("above-max", 5), ("absent", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swSensorStatus.setStatus('current') if mibBuilder.loadTexts: swSensorStatus.setDescription('The current status of the sensor.') swSensorValue = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swSensorValue.setStatus('current') if mibBuilder.loadTexts: swSensorValue.setDescription('The current value (reading) of the sensor. The value, -2147483648, represents an unknown quantity. It also means that the sensor does not have the capability to measure the actual value. In V2.0, the temperature sensor value will be in Celsius; the fan value will be in RPM (revolution per minute); and the power supply sensor reading will be unknown.') swSensorInfo = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swSensorInfo.setStatus('current') if mibBuilder.loadTexts: swSensorInfo.setDescription("Additional displayable information on the sensor. In V2.x, it contains the sensor type and number in textual format. For example, 'Temp 3', 'Fan 6'.") swTrackChangesInfo = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 23), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: swTrackChangesInfo.setStatus('current') if mibBuilder.loadTexts: swTrackChangesInfo.setDescription('Track changes string. For trap only') swID = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 24), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swID.setStatus('current') if mibBuilder.loadTexts: swID.setDescription('The number of the logical switch (0/1)') swEtherIPAddress = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 25), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: swEtherIPAddress.setStatus('current') if mibBuilder.loadTexts: swEtherIPAddress.setDescription('The IP Address of the Ethernet interface of this logical switch.') swEtherIPMask = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 26), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: swEtherIPMask.setStatus('current') if mibBuilder.loadTexts: swEtherIPMask.setDescription('The IP Mask of the Ethernet interface of this logical switch.') swFCIPAddress = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 27), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCIPAddress.setStatus('current') if mibBuilder.loadTexts: swFCIPAddress.setDescription('The IP Address of the FC interface of this logical switch.') swFCIPMask = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 28), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCIPMask.setStatus('current') if mibBuilder.loadTexts: swFCIPMask.setDescription('The IP Mask of the FC interface of this logical switch.') swIPv6Address = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 29), DisplayString()) if mibBuilder.loadTexts: swIPv6Address.setStatus('current') if mibBuilder.loadTexts: swIPv6Address.setDescription('IPV6 address.') swIPv6Status = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("tentative", 1), ("preferred", 2), ("ipdeprecated", 3), ("inactive", 4)))) if mibBuilder.loadTexts: swIPv6Status.setStatus('current') if mibBuilder.loadTexts: swIPv6Status.setDescription('The current status of ipv6 address.') swModel = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("switch7500", 1), ("switch7500E", 2), ("other", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swModel.setStatus('current') if mibBuilder.loadTexts: swModel.setDescription('Indicates whether the switch is 7500 or 7500E .') swTestString = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 32), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 255))) if mibBuilder.loadTexts: swTestString.setStatus('current') if mibBuilder.loadTexts: swTestString.setDescription('presence of this string represents test trap.') swPortList = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 33), OctetString()) if mibBuilder.loadTexts: swPortList.setStatus('current') if mibBuilder.loadTexts: swPortList.setDescription('This string represents the list of ports and its WWN when ports moved from one switch to another.') swBrcdTrapBitMask = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 34), Integer32()) if mibBuilder.loadTexts: swBrcdTrapBitMask.setStatus('current') if mibBuilder.loadTexts: swBrcdTrapBitMask.setDescription('Type of notification will be represented by a single bit in this variable. 0x01 - Fabric change event 0x02 - Device change event 0x04 - Fapwwn change event 0x08 - FDMI events.') swFCPortPrevType = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("unknown", 1), ("other", 2), ("fl-port", 3), ("f-port", 4), ("e-port", 5), ("g-port", 6), ("ex-port", 7)))) if mibBuilder.loadTexts: swFCPortPrevType.setStatus('current') if mibBuilder.loadTexts: swFCPortPrevType.setDescription('This represents port type of a port before it goes online/offline and it is valid only in swFcPortSCN trap') swDeviceStatus = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 36), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("login", 1), ("logout", 2), ("unknown", 3)))) if mibBuilder.loadTexts: swDeviceStatus.setStatus('current') if mibBuilder.loadTexts: swDeviceStatus.setDescription('This represents the attached device status. The status will change whenever port/node goes to online/offline') swDomainID = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 1), SwDomainIndex()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swDomainID.setStatus('current') if mibBuilder.loadTexts: swDomainID.setDescription('The current Fibre Channel domain ID of the switch. To set a new value, the switch (swAdmStatus) must be in offline or testing state.') swPrincipalSwitch = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swPrincipalSwitch.setStatus('current') if mibBuilder.loadTexts: swPrincipalSwitch.setDescription('This object indicates whether the switch is the Principal switch as per FC-SW.') swNumNbs = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swNumNbs.setStatus('current') if mibBuilder.loadTexts: swNumNbs.setDescription('The number of Inter-Switch Links in the (immediate) neighborhood.') swNbTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9), ) if mibBuilder.loadTexts: swNbTable.setStatus('current') if mibBuilder.loadTexts: swNbTable.setDescription('This table contains the ISLs in the immediate neighborhood of the switch.') swNbEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1), ).setIndexNames((0, "SW-MIB", "swNbIndex")) if mibBuilder.loadTexts: swNbEntry.setStatus('current') if mibBuilder.loadTexts: swNbEntry.setDescription('An entry containing each neighbor ISL parameters.') swNbIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 1), SwNbIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swNbIndex.setStatus('current') if mibBuilder.loadTexts: swNbIndex.setDescription('This object identifies the neighbor ISL entry.') swNbMyPort = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 2), SwPortIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swNbMyPort.setStatus('current') if mibBuilder.loadTexts: swNbMyPort.setDescription('This is the port that has an ISL to another switch.') swNbRemDomain = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 3), SwDomainIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swNbRemDomain.setStatus('current') if mibBuilder.loadTexts: swNbRemDomain.setDescription('This is the Fibre Channel domain on the other end of the ISL.') swNbRemPort = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 4), SwPortIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swNbRemPort.setStatus('current') if mibBuilder.loadTexts: swNbRemPort.setDescription('This is the port index on the other end of the ISL.') swNbBaudRate = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 8, 16, 32, 64, 128, 256, 512))).clone(namedValues=NamedValues(("other", 1), ("oneEighth", 2), ("quarter", 4), ("half", 8), ("full", 16), ("double", 32), ("quadruple", 64), ("octuple", 128), ("decuple", 256), ("sexdecuple", 512)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swNbBaudRate.setStatus('current') if mibBuilder.loadTexts: swNbBaudRate.setDescription('The baud rate of the ISL.') swNbIslState = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("sw-down", 0), ("sw-init", 1), ("sw-internal2", 2), ("sw-internal3", 3), ("sw-internal4", 4), ("sw-active", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swNbIslState.setStatus('current') if mibBuilder.loadTexts: swNbIslState.setDescription('The current state of the ISL. The swNbIslState will be 0 when ISL is in incompatible state or port is a slave port.') swNbIslCost = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swNbIslCost.setStatus('current') if mibBuilder.loadTexts: swNbIslCost.setDescription('The current link cost of the ISL.') swNbRemPortName = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swNbRemPortName.setStatus('current') if mibBuilder.loadTexts: swNbRemPortName.setDescription('The World_wide_Name of the remote port.') swFabricMemTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10), ) if mibBuilder.loadTexts: swFabricMemTable.setStatus('current') if mibBuilder.loadTexts: swFabricMemTable.setDescription('This table contains information on the member switches of a fabric. This may not be available on all versions of Fabric OS.') swFabricMemEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1), ).setIndexNames((0, "SW-MIB", "swFabricMemWwn")) if mibBuilder.loadTexts: swFabricMemEntry.setStatus('current') if mibBuilder.loadTexts: swFabricMemEntry.setDescription('An entry containing each switch in the fabric.') swFabricMemWwn = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 1), FcWwn()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFabricMemWwn.setStatus('current') if mibBuilder.loadTexts: swFabricMemWwn.setDescription('This object identifies the World wide name of the member switch.') swFabricMemDid = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 2), SwDomainIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFabricMemDid.setStatus('current') if mibBuilder.loadTexts: swFabricMemDid.setDescription('This object identifies the domain id of the member switch.') swFabricMemName = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFabricMemName.setStatus('current') if mibBuilder.loadTexts: swFabricMemName.setDescription('This object identifies the name of the member switch.') swFabricMemEIP = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 4), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFabricMemEIP.setStatus('current') if mibBuilder.loadTexts: swFabricMemEIP.setDescription('This object identifies the ethernet IP address of the member switch.') swFabricMemFCIP = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 5), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFabricMemFCIP.setStatus('current') if mibBuilder.loadTexts: swFabricMemFCIP.setDescription('This object identifies the Fibre Channel IP address of the member switch.') swFabricMemGWIP = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 6), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFabricMemGWIP.setStatus('current') if mibBuilder.loadTexts: swFabricMemGWIP.setDescription('This object identifies the Gateway IP address of the member switch.') swFabricMemType = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFabricMemType.setStatus('current') if mibBuilder.loadTexts: swFabricMemType.setDescription('This object identifies the member switch type.') swFabricMemShortVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 24))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFabricMemShortVersion.setStatus('current') if mibBuilder.loadTexts: swFabricMemShortVersion.setDescription('This object identifies Fabric OS version of the member switch.') swIDIDMode = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swIDIDMode.setStatus('current') if mibBuilder.loadTexts: swIDIDMode.setDescription('Status of Insistent Domain ID (IDID) mode. Status indicating IDID mode is enabled or not.') swPmgrEventType = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 6))).clone(namedValues=NamedValues(("create", 0), ("delete", 1), ("moveport", 2), ("fidchange", 3), ("basechange", 4), ("vfstatechange", 6)))) if mibBuilder.loadTexts: swPmgrEventType.setStatus('current') if mibBuilder.loadTexts: swPmgrEventType.setDescription('Indicates Partition manager event type.') swPmgrEventTime = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))) if mibBuilder.loadTexts: swPmgrEventTime.setStatus('current') if mibBuilder.loadTexts: swPmgrEventTime.setDescription('This object identifies the date and time when this pmgr event occurred, in textual format.') swPmgrEventDescr = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))) if mibBuilder.loadTexts: swPmgrEventDescr.setStatus('current') if mibBuilder.loadTexts: swPmgrEventDescr.setDescription('This object identifies the textual description of the pmgr event.') swVfId = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swVfId.setStatus('current') if mibBuilder.loadTexts: swVfId.setDescription('The Virtual fabric id.') swVfName = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 16), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: swVfName.setStatus('current') if mibBuilder.loadTexts: swVfName.setDescription('This represents the virtual fabric name configured in the switch') swAgtCmtyTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11), ) if mibBuilder.loadTexts: swAgtCmtyTable.setStatus('deprecated') if mibBuilder.loadTexts: swAgtCmtyTable.setDescription('A table that contains, one entry for each Community, the access control and parameters of the Community.') swauthProtocolPassword = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swauthProtocolPassword.setStatus('current') if mibBuilder.loadTexts: swauthProtocolPassword.setDescription('This entry is created specific to the Pharos switch to change the password for the auth protocol to reserved user DirectorServerSNMPv3User') swprivProtocolPassword = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swprivProtocolPassword.setStatus('current') if mibBuilder.loadTexts: swprivProtocolPassword.setDescription('This entry is created specific to the Pharos switch to change the password for the priv protocol to reserved user DirectorServerSNMPv3User') swAgtCmtyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11, 1), ).setIndexNames((0, "SW-MIB", "swAgtCmtyIdx")) if mibBuilder.loadTexts: swAgtCmtyEntry.setStatus('deprecated') if mibBuilder.loadTexts: swAgtCmtyEntry.setDescription('An entry containing the Community parameters.') swAgtCmtyIdx = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: swAgtCmtyIdx.setStatus('deprecated') if mibBuilder.loadTexts: swAgtCmtyIdx.setDescription('This object identifies the SNMPv1 Community entry.') swAgtCmtyStr = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(2, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swAgtCmtyStr.setStatus('deprecated') if mibBuilder.loadTexts: swAgtCmtyStr.setDescription('This is a Community string supported by the agent. If a new value is set successfully, it takes effect immediately.') swAgtTrapRcp = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swAgtTrapRcp.setStatus('deprecated') if mibBuilder.loadTexts: swAgtTrapRcp.setDescription('This is the trap recipient associated with the Community. If a new value is set successfully, it takes effect immediately.') swAgtTrapSeverityLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11, 1, 4), SwSevType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swAgtTrapSeverityLevel.setStatus('deprecated') if mibBuilder.loadTexts: swAgtTrapSeverityLevel.setDescription("This is the trap severity level associated with the swAgtTrapRcp. The trap severity level in conjunction with the an event's severity level. When an event occurs and if its severity level is at or below the set value, the SNMP trap is sent to configured trap recipients. The severity level is limited to particular events. If a new value is set successfully, it takes effect immediately.") swFCPortCapacity = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortCapacity.setStatus('current') if mibBuilder.loadTexts: swFCPortCapacity.setDescription('The maximum number of of physical ports on the switch. This will include ports of the protocol: FC, FCIP(GE ports), VE(FCIP)...') swFCPortTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2), ) if mibBuilder.loadTexts: swFCPortTable.setStatus('current') if mibBuilder.loadTexts: swFCPortTable.setDescription('A table that contains, one entry for each switch port, configuration and service parameters of the port.') swFCPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1), ).setIndexNames((0, "SW-MIB", "swFCPortIndex")) if mibBuilder.loadTexts: swFCPortEntry.setStatus('current') if mibBuilder.loadTexts: swFCPortEntry.setDescription('An entry containing the configuration and service parameters of the switch port.') swFCPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 1), SwPortIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortIndex.setStatus('current') if mibBuilder.loadTexts: swFCPortIndex.setDescription('This object identifies the switch port index. Note that the value of a port index is 1 higher than the port number labeled on the front panel. E.g. port index 1 correspond to port number 0.') swFCPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("stitch", 1), ("flannel", 2), ("loom", 3), ("bloom", 4), ("rdbloom", 5), ("wormhole", 6), ("other", 7), ("unknown", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortType.setStatus('current') if mibBuilder.loadTexts: swFCPortType.setDescription('This object identifies the type of switch port. It may be of type stitch(1), flannel(2), loom(3) , bloom(4),rdbloom(5) or wormhole(6).') swFCPortPhyState = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 255))).clone(namedValues=NamedValues(("noCard", 1), ("noTransceiver", 2), ("laserFault", 3), ("noLight", 4), ("noSync", 5), ("inSync", 6), ("portFault", 7), ("diagFault", 8), ("lockRef", 9), ("validating", 10), ("invalidModule", 11), ("noSigDet", 14), ("unknown", 255)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortPhyState.setStatus('current') if mibBuilder.loadTexts: swFCPortPhyState.setDescription('This object identifies the physical state of the port: noCard(1) no card present in this switch slot; noTransceiver(2) no Transceiver module in this port. noGbic(2) was used previously. Transceiver is the generic name for GBIC, SFP etc.; laserFault(3) the module is signaling a laser fault (defective Transceiver); noLight(4) the module is not receiving light; noSync(5) the module is receiving light but is out of sync; inSync(6) the module is receiving light and is in sync; portFault(7) the port is marked faulty (defective Transceiver, cable or device); diagFault(8) the port failed diagnostics (defective G_Port or FL_Port card or motherboard); lockRef(9) the port is locking to the reference signal. validating(10) Validation is in progress invalidModule(11) Invalid SFP unknown(255) unknown. ') swFCPortOpStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 0), ("online", 1), ("offline", 2), ("testing", 3), ("faulty", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortOpStatus.setStatus('current') if mibBuilder.loadTexts: swFCPortOpStatus.setDescription('This object identifies the operational status of the port. The online(1) state indicates that user frames can be passed. The unknown(0) state indicates that likely the port module is physically absent (see swFCPortPhyState).') swFCPortAdmStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("online", 1), ("offline", 2), ("testing", 3), ("faulty", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFCPortAdmStatus.setStatus('current') if mibBuilder.loadTexts: swFCPortAdmStatus.setDescription('The desired state of the port. A management station may place the port in a desired state by setting this object accordingly. The testing(3) state indicates that no user frames can be passed. As the result of either explicit management action or per configuration information accessible by the switch, swFCPortAdmStatus is then changed to either the online(1) or testing(3) states, or remains in the offline(2) state.') swFCPortLinkState = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("loopback", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFCPortLinkState.setStatus('current') if mibBuilder.loadTexts: swFCPortLinkState.setDescription("This object indicates the link state of the port. The value may be: enabled(1) - port is allowed to participate in the FC-PH protocol with its attached port (or ports if it is in a FC-AL loop); disabled(2) - the port is not allowed to participate in the FC-PH protocol with its attached port(s); loopback(3) - the port may transmit frames through an internal path to verify the health of the transmitter and receiver path. Note that when the port's link state changes, its operational status (swFCPortOpStatus) will be affected.") swFCPortTxType = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 1), ("lw", 2), ("sw", 3), ("ld", 4), ("cu", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortTxType.setStatus('current') if mibBuilder.loadTexts: swFCPortTxType.setDescription('This object indicates the media transmitter type of the port. The value may be: unknown(1) cannot determined to the port driver lw(2) long wave laser sw(3) short wave laser ld(4) long wave LED cu(5) copper (electrical).') swFCPortTxWords = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortTxWords.setStatus('current') if mibBuilder.loadTexts: swFCPortTxWords.setDescription('This object counts the number of Fibre Channel words that the port has transmitted.') swFCPortRxWords = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxWords.setStatus('current') if mibBuilder.loadTexts: swFCPortRxWords.setDescription('This object counts the number of Fibre Channel words that the port has received.') swFCPortTxFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortTxFrames.setStatus('current') if mibBuilder.loadTexts: swFCPortTxFrames.setDescription('This object counts the number of (Fibre Channel) frames that the port has transmitted.') swFCPortRxFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxFrames.setStatus('current') if mibBuilder.loadTexts: swFCPortRxFrames.setDescription('This object counts the number of (Fibre Channel) frames that the port has received.') swFCPortRxC2Frames = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxC2Frames.setStatus('current') if mibBuilder.loadTexts: swFCPortRxC2Frames.setDescription('This object counts the number of Class 2 frames that the port has received.') swFCPortRxC3Frames = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxC3Frames.setStatus('current') if mibBuilder.loadTexts: swFCPortRxC3Frames.setDescription('This object counts the number of Class 3 frames that the port has received.') swFCPortRxLCs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxLCs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxLCs.setDescription('This object counts the number of Link Control frames that the port has received.') swFCPortRxMcasts = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxMcasts.setStatus('current') if mibBuilder.loadTexts: swFCPortRxMcasts.setDescription('This object counts the number of Multicast frames that the port has received.') swFCPortTooManyRdys = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortTooManyRdys.setStatus('current') if mibBuilder.loadTexts: swFCPortTooManyRdys.setDescription('This object counts the number of times when RDYs exceeds the frames received.') swFCPortNoTxCredits = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortNoTxCredits.setStatus('current') if mibBuilder.loadTexts: swFCPortNoTxCredits.setDescription('This object counts the number of times when the transmit credit has reached zero.') swFCPortRxEncInFrs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxEncInFrs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxEncInFrs.setDescription('This object counts the number of encoding error or disparity error inside frames received.') swFCPortRxCrcs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxCrcs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxCrcs.setDescription('This object counts the number of CRC errors detected for frames received.') swFCPortRxTruncs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxTruncs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxTruncs.setDescription('This object counts the number of truncated frames that the port has received.') swFCPortRxTooLongs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxTooLongs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxTooLongs.setDescription('This object counts the number of received frames that are too long.') swFCPortRxBadEofs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxBadEofs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxBadEofs.setDescription('This object counts the number of received frames that have bad EOF delimiter.') swFCPortRxEncOutFrs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxEncOutFrs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxEncOutFrs.setDescription('This object counts the number of encoding error or disparity error outside frames received.') swFCPortRxBadOs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortRxBadOs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxBadOs.setDescription('This object counts the number of invalid Ordered Sets received.') swFCPortC3Discards = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 28), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortC3Discards.setStatus('current') if mibBuilder.loadTexts: swFCPortC3Discards.setDescription('This object counts the number of Class 3 frames that the port has discarded.') swFCPortMcastTimedOuts = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 29), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortMcastTimedOuts.setStatus('current') if mibBuilder.loadTexts: swFCPortMcastTimedOuts.setDescription('This object counts the number of Multicast frames that has been timed out.') swFCPortTxMcasts = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 30), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortTxMcasts.setStatus('current') if mibBuilder.loadTexts: swFCPortTxMcasts.setDescription('This object counts the number of Multicast frames that has been transmitted.') swFCPortLipIns = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 31), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortLipIns.setStatus('current') if mibBuilder.loadTexts: swFCPortLipIns.setDescription('This object counts the number of Loop Initializations that has been initiated by loop devices attached.') swFCPortLipOuts = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 32), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortLipOuts.setStatus('current') if mibBuilder.loadTexts: swFCPortLipOuts.setDescription('This object counts the number of Loop Initializations that has been initiated by the port.') swFCPortLipLastAlpa = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 33), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortLipLastAlpa.setStatus('current') if mibBuilder.loadTexts: swFCPortLipLastAlpa.setDescription('This object indicates the Physical Address (AL_PA) of the loop device that initiated the last Loop Initialization.') swFCPortWwn = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 34), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortWwn.setStatus('current') if mibBuilder.loadTexts: swFCPortWwn.setDescription('The World_wide_Name of the Fibre Channel port. The contents of an instance are in the IEEE extended format as specified in FC-PH; the 12-bit port identifier represents the port number within the switch.') swFCPortSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("one-GB", 1), ("two-GB", 2), ("auto-Negotiate", 3), ("four-GB", 4), ("eight-GB", 5), ("ten-GB", 6), ("unknown", 7), ("sixteen-GB", 8)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFCPortSpeed.setStatus('obsolete') if mibBuilder.loadTexts: swFCPortSpeed.setDescription('The desired baud rate for the port. It can have the values of 1GB (1), 2GB (2), Auto-Negotiate (3), 4GB (4), 8GB (5), 10GB (6), 16GB (8). Some of the above values may not be supported by all type of switches.') swFCPortName = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 36), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortName.setStatus('current') if mibBuilder.loadTexts: swFCPortName.setDescription('A string indicates the name of the addressed port. The names should be persistent across switch reboots. Port names do not have to be unique within a switch or within a fabric.') swFCPortSpecifier = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 37), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortSpecifier.setStatus('current') if mibBuilder.loadTexts: swFCPortSpecifier.setDescription("This string indicates the physical port number of the addressed port. The format of the string is: <slot>/port, where 'slot' being present only for bladed systems. ") swFCPortFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 38), FcPortFlag()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortFlag.setStatus('current') if mibBuilder.loadTexts: swFCPortFlag.setDescription('A bit map of port status flags which includes the information of port type. Currently this will indicate if the port is virtual or physical.') swFCPortBrcdType = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 39), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("unknown", 1), ("other", 2), ("fl-port", 3), ("f-port", 4), ("e-port", 5), ("g-port", 6), ("ex-port", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFCPortBrcdType.setStatus('current') if mibBuilder.loadTexts: swFCPortBrcdType.setDescription('The Brocade port type.') swFCPortDisableReason = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 40), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230))).clone(namedValues=NamedValues(("r-recover-fail", 1), ("r-invalid-reason", 2), ("r-forced", 3), ("r-sw-disabled", 4), ("r-bl-disabled", 5), ("r-slot-off", 6), ("r-sw-enabled", 7), ("r-bl-enabled", 8), ("r-slot-on", 9), ("r-persistid", 10), ("r-sw-violation", 11), ("r-prv-dev-violation", 12), ("r-pub-dev-violation", 13), ("r-port-data-fail", 14), ("r-online-incomplete", 15), ("r-online-route-fail", 16), ("r-inconsistent", 17), ("r-set-vcc-fail", 18), ("r-ecp-in-testing", 19), ("r-elp-in-testing", 20), ("r-ecp-retries-exceeded", 21), ("r-invalid-ecp-state", 22), ("r-bad-ecp-rcvd", 23), ("r-send-rtmark-fail", 24), ("r-send-ecp-fail", 25), ("r-save-link-rtt-fail", 26), ("r-em-incnst", 27), ("r-pci-attach-fail", 28), ("r-buf-starv", 29), ("r-elp-fctl-mismatch", 30), ("r-eport-disabled", 31), ("r-trunk-with-vcxlt", 32), ("r-sw-fl-port-not-ready", 33), ("r-link-reinit", 34), ("r-domain-id-change", 35), ("r-auth-rejected", 36), ("r-auth-timeout", 37), ("r-auth-fail-retry", 38), ("r-fcr-conf-mismatch1", 39), ("r-fcr-conf-mismatch2", 40), ("r-fcr-port-ld-mode-mismatch", 41), ("r-fcr-ld-credit-mismatch", 42), ("r-fcr-set-vcc-failed", 43), ("r-fcr-set-rtc-failed", 44), ("r-fcr-elp-ver-inconsis", 45), ("r-fcr-elp-fctl-mismatch", 46), ("r-fcr-pid-mismatch", 47), ("r-fcr-tov-mismatch", 48), ("r-fcr-ld-incompat", 49), ("r-fcr-isolated", 50), ("r-elp-retries-exceeded", 51), ("r-fcr-exports-exceeded", 52), ("r-fcr-license", 53), ("r-fcr-conf-ex", 54), ("r-fcr-ftag-over", 55), ("r-fcr-ftag-conflict", 56), ("r-fcr-fowner-conflict", 57), ("r-fcr-zone-resource", 58), ("r-fcr-port-state-to", 59), ("r-fcr-authn-reject", 60), ("r-fcr-sec-fcs-list", 61), ("r-fcr-sec-failure", 62), ("r-fcr-incompatible-mode", 63), ("r-fcr-sec-scc-list", 64), ("r-fcr-generic", 65), ("r-sw-ex-port-not-ready", 66), ("r-fcr-class-f-incompat", 67), ("r-fcr-class-n-incompat", 68), ("r-fcr-invalid-flow-rcvd", 69), ("r-fcr-state-disabled", 70), ("r-fdd-strict-exist", 71), ("r-last-port-disable-msg", 72), ("r-sw-l-port-not-support", 73), ("r-peer-port-in-di-zone", 74), ("r-zone-incompat", 75), ("r-sw-config-l-port-not-support", 76), ("r-sw-port-mirror-configured", 77), ("r-nportlogin-inprogress", 78), ("r-nonpiv", 79), ("r-nomapping", 80), ("r-unknowntype", 81), ("r-nportoffline", 82), ("r-flogifailed", 83), ("r-nportbusy", 84), ("r-noflogi", 85), ("r-noflogiresp", 86), ("r-flogidupalpa", 87), ("r-loopcfg", 88), ("r-noenclicense", 89), ("r-nofiportmapping", 90), ("r-brcdfabconn", 91), ("r-port-reset", 92), ("r-floginport", 93), ("r-fdd-strict-conflict", 94), ("r-fdd-cfg-conflict", 95), ("r-fdd-cfg-conflict-na-neigh", 96), ("r-fcr-insistent-front-did-mismatch", 97), ("r-fcr-fabric-binding-failure", 98), ("r-fcr-non-standard-domain-offset", 99), ("r-area-in-use", 100), ("r-mstr-diff-pg", 101), ("r-mstr-diff-area", 102), ("r-ta-not-supported", 103), ("r-eport-not-supported", 104), ("r-fport-not-supported", 105), ("r-cfg-not-supported", 106), ("r-port-ll-th-exceeded", 107), ("r-port-synl-th-exceeded", 108), ("r-port-pe-th-exceeded", 109), ("f-port-disable-no-trk-lic", 110), ("r-port-inw-th-exceeded", 111), ("r-port-crc-th-exceeded", 112), ("f-port-tr-disable-speed-not-ok", 113), ("r-port-auto-disable", 114), ("r-fcr-export-in-non-base-sw", 115), ("r-base-switch-supports-no-device", 116), ("r-port-trunk-proto-error", 117), ("r-no-area-avail", 118), ("r-cannot-unbind-existing-area", 119), ("r-cannot-use-10bit-area", 120), ("r-authentication-required", 121), ("r-port-lr-th-exceeded", 122), ("r-fcr-export-lf-conflict", 123), ("r-incompat", 124), ("r-did-overlap", 125), ("r-zone-conflict", 126), ("r-eport-seg", 127), ("r-no-license", 128), ("r-platform-db", 129), ("r-sec-incompat", 130), ("r-sec-violation", 131), ("r-ecp-longdist", 132), ("r-dup-wwn", 133), ("r-eport-isolated", 134), ("r-ad", 135), ("r-esc-did-offset", 136), ("r-esc-etiz", 137), ("r-esc-fid", 138), ("r-safe-zone", 139), ("r-vf", 140), ("r-vf-bs-incompat", 141), ("r-pers-pid-on-lport", 142), ("r-pers-pid-portaddr-collision", 143), ("r-pers-pid-port-on-same-area", 144), ("r-pers-pid-port-addr-bnd", 145), ("r-msfr", 146), ("r-sw-halfbw-lic", 147), ("r-1g-mode-incompat", 148), ("r-10g-mode-incompat", 149), ("r-dual-mode-incompat", 150), ("r-implict-plt-service-block", 151), ("r-port-st-th-exceeded", 152), ("r-port-c3txto-th-exceeded", 153), ("r-eport-not-supported-def-sw", 154), ("r-eport-ll-th-exceeded", 155), ("r-eport-synl-th-exceeded", 156), ("r-eport-pe-th-exceeded", 157), ("r-eport-inw-th-exceeded", 158), ("r-eport-crc-th-exceeded", 159), ("r-eport-lr-th-exceeded", 160), ("r-eport-st-th-exceeded", 161), ("r-eport-c3txto-th-exceeded", 162), ("r-fopport-ll-th-exceeded", 163), ("r-fopport-synl-th-exceeded", 164), ("r-fopport-pe-th-exceeded", 165), ("r-fopport-inw-th-exceeded", 166), ("r-fopport-crc-th-exceeded", 167), ("r-fopport-lr-th-exceeded", 168), ("r-fopport-st-th-exceeded", 169), ("r-fopport-c3txto-th-exceeded", 170), ("r-fcuport-ll-th-exceeded", 171), ("r-fcuport-synl-th-exceeded", 172), ("r-fcuport-pe-th-exceeded", 173), ("r-fcuport-inw-th-exceeded", 174), ("r-fcuport-crc-th-exceeded", 175), ("r-fcuport-lr-th-exceeded", 176), ("r-fcuport-st-th-exceeded", 177), ("r-fcuport-c3txto-th-exceeded", 178), ("r-port-no-area-avail-pers-disable", 179), ("r-eport-locked", 180), ("r-enh-tizone", 181), ("r-sw-port-swap-not-supported", 182), ("r-fport-slow-drain-condition", 183), ("r-esc-vlanid", 184), ("r-port-recov-state", 185), ("r-port-auto-disable-losn", 186), ("r-port-auto-disable-losg", 187), ("r-port-auto-disable-ols", 188), ("r-port-auto-disable-nos", 189), ("r-port-auto-disable-lip", 190), ("r-port-compression", 191), ("r-port-encryption", 192), ("r-port-enccomp-res", 193), ("r-port-decommissioned", 194), ("r-port-dportmode", 195), ("r-port-dport-incompat", 196), ("r-port-enc-comp-mismatch", 197), ("r-non-rcs-rem-dom", 198), ("r-port-fips-comp-mismatch", 199), ("r-port-non-fips-comp-mismatch", 200), ("r-port-enc-auth-disabled", 201), ("r-port-disable-on-zeroize", 202), ("r-cfgspeed-not-supported", 203), ("r-fcr-ex-port-not-allowed", 204), ("r-port-duplicate-pwwn", 205), ("r-fcr-trunk-master-sfid-not-set", 206), ("r-nportistrunkmem", 207), ("r-policynotsupported", 208), ("r-no-icl-license", 209), ("r-no-ten-gig-license", 210), ("r-fdd-strict-scc-conflict", 211), ("r-fdd-strict-dcc-conflict", 212), ("r-fdd-strict-fcs-conflict", 213), ("r-fdd-strict-fabwide-conflict", 214), ("r-fdd-strict-pwd-conflict", 215), ("r-fcr-interop-conf", 216), ("r-port-enc-interop-conflict", 217), ("r-port-comp-interop-conflict", 218), ("r-no-port-open-rsp", 219), ("r-no-eicl-license", 220), ("r-eicl-license-limited", 221), ("r-esc-base-sw", 222), ("r-sw-cpu-overload", 223), ("r-no-icl-pod2-license", 224), ("r-port-area-mismatch-pers-disable", 225), ("r-unauthorized-device", 226), ("r-max-flogi-reached", 227), ("r-auth-not-supported-in-switch", 228), ("r-icl-ex-on-non-vf", 229), ("r-user-disabled-reason", 230)))) if mibBuilder.loadTexts: swFCPortDisableReason.setStatus('current') if mibBuilder.loadTexts: swFCPortDisableReason.setDescription('It indicates the state change reason when port goes from online to offline') swNsLocalNumEntry = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsLocalNumEntry.setStatus('current') if mibBuilder.loadTexts: swNsLocalNumEntry.setDescription('The number of local Name Server entries.') swNsLocalTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2), ) if mibBuilder.loadTexts: swNsLocalTable.setStatus('current') if mibBuilder.loadTexts: swNsLocalTable.setDescription('The table of local Name Server entries.') swNsLocalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1), ).setIndexNames((0, "SW-MIB", "swNsEntryIndex")) if mibBuilder.loadTexts: swNsLocalEntry.setStatus('current') if mibBuilder.loadTexts: swNsLocalEntry.setDescription('An entry of the local Name Server database.') swNsEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsEntryIndex.setStatus('current') if mibBuilder.loadTexts: swNsEntryIndex.setDescription('The object identifies the Name Server database entry.') swNsPortID = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsPortID.setStatus('current') if mibBuilder.loadTexts: swNsPortID.setDescription('The object identifies the Fibre Channel port address ID of the entry.') swNsPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("nPort", 1), ("nlPort", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsPortType.setStatus('current') if mibBuilder.loadTexts: swNsPortType.setDescription('The object identifies the type of port: N_Port, NL_Port, etc., for this entry. The type is defined in FC-GS-2.') swNsPortName = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 4), FcWwn()).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsPortName.setStatus('current') if mibBuilder.loadTexts: swNsPortName.setDescription('The object identifies the Fibre Channel World_wide Name of the port entry.') swNsPortSymb = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsPortSymb.setStatus('current') if mibBuilder.loadTexts: swNsPortSymb.setDescription("The object identifies the contents of a Symbolic Name of the port entry. In FC-GS-2, a Symbolic Name consists of a byte array of 1 through 255 bytes, and the first byte of the array specifies the length of its 'contents'. This object variable corresponds to the 'contents' of the Symbolic Name, without the first byte.") swNsNodeName = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 6), FcWwn()).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsNodeName.setStatus('current') if mibBuilder.loadTexts: swNsNodeName.setDescription('The object identifies the Fibre Channel World_wide Name of the associated node as defined in FC-GS-2.') swNsNodeSymb = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsNodeSymb.setStatus('current') if mibBuilder.loadTexts: swNsNodeSymb.setDescription("The object identifies the contents of a Symbolic Name of the the node associated with the entry. In FC-GS-2, a Symbolic Name consists of a byte array of 1 through 255 bytes, and the first byte of the array specifies the length of its 'contents'. This object variable corresponds to the 'contents' of the Symbolic Name, without the first byte (specifying the length).") swNsIPA = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsIPA.setStatus('current') if mibBuilder.loadTexts: swNsIPA.setDescription('The object identifies the Initial Process Associator of the node for the entry as defined in FC-GS-2.') swNsIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsIpAddress.setStatus('current') if mibBuilder.loadTexts: swNsIpAddress.setDescription('The object identifies the IP address of the node for the entry as defined in FC-GS-2. The format of the address is in IPv6.') swNsCos = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15))).clone(namedValues=NamedValues(("class-F", 1), ("class-1", 2), ("class-F-1", 3), ("class-2", 4), ("class-F-2", 5), ("class-1-2", 6), ("class-F-1-2", 7), ("class-3", 8), ("class-F-3", 9), ("class-1-3", 10), ("class-F-1-3", 11), ("class-2-3", 12), ("class-F-2-3", 13), ("class-1-2-3", 14), ("class-F-1-2-3", 15)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsCos.setStatus('current') if mibBuilder.loadTexts: swNsCos.setDescription('The object identifies the class of services supported by the port. The value is a bit-map defined as follows: o bit 0 is class F, o bit 1 is class 1, o bit 2 is class 2, o bit 3 is class 3, o bit 4 is class 4, etc.') swNsFc4 = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(32, 32)).setFixedLength(32)).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsFc4.setStatus('current') if mibBuilder.loadTexts: swNsFc4.setDescription('The object identifies the FC-4s supported by the port as defined in FC-GS-2.') swNsIpNxPort = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsIpNxPort.setStatus('current') if mibBuilder.loadTexts: swNsIpNxPort.setDescription('The object identifies IpAddress of the Nx_port for the entry.') swNsWwn = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsWwn.setStatus('current') if mibBuilder.loadTexts: swNsWwn.setDescription('The object identifies the World Wide Name (WWN) of the Fx_port for the entry.') swNsHardAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 14), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readonly") if mibBuilder.loadTexts: swNsHardAddr.setStatus('current') if mibBuilder.loadTexts: swNsHardAddr.setDescription('The object identifies the 24-bit hard address of the node for the entry.') swEventTrapLevel = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 0), ("critical", 1), ("error", 2), ("warning", 3), ("informational", 4), ("debug", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swEventTrapLevel.setStatus('deprecated') if mibBuilder.loadTexts: swEventTrapLevel.setDescription("swAgtTrapSeverityLevel, in absence of swEventTrapLevel, specifies the Trap Severity Level of each defined trap recipient host. This object specifies the swEventTrap level in conjunction with an event's severity level. When an event occurs and if its severity level is at or below the value specified by this object instance, the agent will send the associated swEventTrap to configured recipients.") swEventNumEntries = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swEventNumEntries.setStatus('current') if mibBuilder.loadTexts: swEventNumEntries.setDescription('The number of entries in the Event Table.') swEventTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5), ) if mibBuilder.loadTexts: swEventTable.setStatus('current') if mibBuilder.loadTexts: swEventTable.setDescription('The table of event entries.') swEventEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1), ).setIndexNames((0, "SW-MIB", "swEventIndex")) if mibBuilder.loadTexts: swEventEntry.setStatus('current') if mibBuilder.loadTexts: swEventEntry.setDescription('An entry of the event table.') swEventIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swEventIndex.setStatus('current') if mibBuilder.loadTexts: swEventIndex.setDescription('This object identifies the event entry.') swEventTimeInfo = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: swEventTimeInfo.setStatus('current') if mibBuilder.loadTexts: swEventTimeInfo.setDescription('This object identifies the date and time when this event occurred, in textual format.') swEventLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("critical", 1), ("error", 2), ("warning", 3), ("informational", 4), ("debug", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swEventLevel.setStatus('current') if mibBuilder.loadTexts: swEventLevel.setDescription('This object identifies the severity level of this event entry.') swEventRepeatCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swEventRepeatCount.setStatus('current') if mibBuilder.loadTexts: swEventRepeatCount.setDescription('This object identifies how many times this particular event has occurred.') swEventDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: swEventDescr.setStatus('current') if mibBuilder.loadTexts: swEventDescr.setDescription('This object identifies the textual description of the event.') swEventVfId = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swEventVfId.setStatus('current') if mibBuilder.loadTexts: swEventVfId.setDescription('This object identifies the Virtual fabric id.') class SwFwActs(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63)) namedValues = NamedValues(("swFwNoAction", 0), ("swFwErrlog", 1), ("swFwSnmptrap", 2), ("swFwErrlogSnmptrap", 3), ("swFwPortloglock", 4), ("swFwErrlogPortloglock", 5), ("swFwSnmptrapPortloglock", 6), ("swFwErrlogSnmptrapPortloglock", 7), ("swFwRn", 8), ("swFwElRn", 9), ("swFwStRn", 10), ("swFwElStRn", 11), ("swFwPlRn", 12), ("swFwElPlRn", 13), ("swFwStPlRn", 14), ("swFwElStPlRn", 15), ("swFwMailAlert", 16), ("swFwMailAlertErrlog", 17), ("swFwMailAlertSnmptrap", 18), ("swFwMailAlertErrlogSnmptrap", 19), ("swFwMailAlertPortloglock", 20), ("swFwMailAlertErrlogPortloglock", 21), ("swFwMailAlertSnmptrapPortloglock", 22), ("swFwMailAlertErrlogSnmptrapPortloglock", 23), ("swFwMailAlertRn", 24), ("swFwElMailAlertRn", 25), ("swFwMailAlertStRn", 26), ("swFwMailAlertElStRn", 27), ("swFwMailAlertPlRn", 28), ("swFwMailAlertElPlRn", 29), ("swFwMailAlertStPlRn", 30), ("swFwMailAlertElStPlRn", 31), ("swFwPf", 32), ("swFwElPf", 33), ("swFwStPf", 34), ("swFwElStPf", 35), ("swFwPlPf", 36), ("swFwElPlPf", 37), ("swFwStPlPf", 38), ("swFwElStPlPf", 39), ("swFwRnPf", 40), ("swFwElRnPf", 41), ("swFwStRnPf", 42), ("swFwElStRnPf", 43), ("swFwPlRnPf", 44), ("swFwElPlRnPf", 45), ("swFwStPlRnPf", 46), ("swFwElStPlRnPf", 47), ("swFwMailAlertPf", 48), ("swFwMailAlertElPf", 49), ("swFwMailAlertStPf", 50), ("swFwMailAlertElStPf", 51), ("swFwMailAlertPlPf", 52), ("swFwMailAlertElPlPf", 53), ("swFwMailAlertStPlPf", 54), ("swFwMailAlertElStPlPf", 55), ("swFwMailAlertRnPf", 56), ("swFwMailAlertElRnPf", 57), ("swFwMailAlertStRnPf", 58), ("swFwMailAlertElStRnPf", 59), ("swFwMailAlertPlRnPf", 60), ("swFwMailAlertElPlRnPf", 61), ("swFwMailAlertStPlRnPf", 62), ("swFwMailAlertElStPlRnPf", 63)) class SwFwLevels(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("swFwReserved", 1), ("swFwDefault", 2), ("swFwCustom", 3)) class SwFwClassesAreas(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152)) namedValues = NamedValues(("swFwEnvTemp", 1), ("swFwEnvFan", 2), ("swFwEnvPs", 3), ("swFwTransceiverTemp", 4), ("swFwTransceiverRxp", 5), ("swFwTransceiverTxp", 6), ("swFwTransceiverCurrent", 7), ("swFwPortLink", 8), ("swFwPortSync", 9), ("swFwPortSignal", 10), ("swFwPortPe", 11), ("swFwPortWords", 12), ("swFwPortCrcs", 13), ("swFwPortRXPerf", 14), ("swFwPortTXPerf", 15), ("swFwPortState", 16), ("swFwFabricEd", 17), ("swFwFabricFr", 18), ("swFwFabricDi", 19), ("swFwFabricSc", 20), ("swFwFabricZc", 21), ("swFwFabricFq", 22), ("swFwFabricFl", 23), ("swFwFabricGs", 24), ("swFwEPortLink", 25), ("swFwEPortSync", 26), ("swFwEPortSignal", 27), ("swFwEPortPe", 28), ("swFwEPortWords", 29), ("swFwEPortCrcs", 30), ("swFwEPortRXPerf", 31), ("swFwEPortTXPerf", 32), ("swFwEPortState", 33), ("swFwFCUPortLink", 34), ("swFwFCUPortSync", 35), ("swFwFCUPortSignal", 36), ("swFwFCUPortPe", 37), ("swFwFCUPortWords", 38), ("swFwFCUPortCrcs", 39), ("swFwFCUPortRXPerf", 40), ("swFwFCUPortTXPerf", 41), ("swFwFCUPortState", 42), ("swFwFOPPortLink", 43), ("swFwFOPPortSync", 44), ("swFwFOPPortSignal", 45), ("swFwFOPPortPe", 46), ("swFwFOPPortWords", 47), ("swFwFOPPortCrcs", 48), ("swFwFOPPortRXPerf", 49), ("swFwFOPPortTXPerf", 50), ("swFwFOPPortState", 51), ("swFwPerfALPACRC", 52), ("swFwPerfEToECRC", 53), ("swFwPerfEToERxCnt", 54), ("swFwPerfEToETxCnt", 55), ("swFwPerffltCusDef", 56), ("swFwTransceiverVoltage", 57), ("swFwSecTelnetViolations", 58), ("swFwSecHTTPViolations", 59), ("swFwSecAPIViolations", 60), ("swFwSecRSNMPViolations", 61), ("swFwSecWSNMPViolations", 62), ("swFwSecSESViolations", 63), ("swFwSecMSViolations", 64), ("swFwSecSerialViolations", 65), ("swFwSecFPViolations", 66), ("swFwSecSCCViolations", 67), ("swFwSecDCCViolations", 68), ("swFwSecLoginViolations", 69), ("swFwSecInvalidTS", 70), ("swFwSecInvalidSign", 71), ("swFwSecInvalidCert", 72), ("swFwSecSlapFail", 73), ("swFwSecSlapBadPkt", 74), ("swFwSecTSOutSync", 75), ("swFwSecNoFcs", 76), ("swFwSecIncompDB", 77), ("swFwSecIllegalCmd", 78), ("swFwSAMTotalDownTime", 79), ("swFwSAMTotalUpTime", 80), ("swFwSAMDurationOfOccur", 81), ("swFwSAMFreqOfOccur", 82), ("swFwResourceFlash", 83), ("swFwEPortUtil", 84), ("swFwEPortPktl", 85), ("swFwPortLr", 86), ("swFwEPortLr", 87), ("swFwFCUPortLr", 88), ("swFwFOPPortLr", 89), ("swFwPortC3Discard", 90), ("swFwEPortC3Discard", 91), ("swFwFCUPortC3Discard", 92), ("swFwFOPPortC3Discard", 93), ("swFwVEPortStateChange", 94), ("swFwVEPortUtil", 95), ("swFwVEPortPktLoss", 96), ("swFwEPortTrunkUtil", 97), ("swFwFCUPortTrunkUtil", 98), ("swFwFOPPortTrunkUtil", 99), ("swFwCPUMemUsage", 100), ("filterFmCfg1", 101), ("filterFmCfg2", 102), ("filterFmCfg3", 103), ("filterFmCfg4", 104), ("filterFmCfg5", 105), ("filterFmCfg6", 106), ("filterFmCfg7", 107), ("filterFmCfg8", 108), ("filterFmCfg9", 109), ("filterFmCfg10", 110), ("filterFmCfg11", 111), ("filterFmCfg12", 112), ("filterFmCfg13", 113), ("filterFmCfg14", 114), ("filterFmCfg15", 115), ("filterFmCfg16", 116), ("filterFmCfg17", 117), ("filterFmCfg18", 118), ("filterFmCfg19", 119), ("filterFmCfg20", 120), ("filterFmCfg21", 121), ("filterFmCfg22", 122), ("filterFmCfg23", 123), ("filterFmCfg24", 124), ("filterFmCfg25", 125), ("filterFmCfg26", 126), ("filterFmCfg27", 127), ("filterFmCfg28", 128), ("filterFmCfg29", 129), ("filterFmCfg30", 130), ("filterFmCfg31", 131), ("filterFmCfg32", 132), ("filterFmCfg33", 133), ("filterFmCfg34", 134), ("filterFmCfg35", 135), ("filterFmCfg36", 136), ("filterFmCfg37", 137), ("filterFmCfg38", 138), ("filterFmCfg39", 139), ("filterFmCfg40", 140), ("filterFmCfg41", 141), ("filterFmCfg42", 142), ("filterFmCfg43", 143), ("filterFmCfg44", 144), ("filterFmCfg45", 145), ("filterFmCfg46", 146), ("filterFmCfg47", 147), ("filterFmCfg48", 148), ("filterFmCfg49", 149), ("filterFmCfg50", 150), ("filterFmCfg51", 151), ("swFwPowerOnHours", 152)) class SwFwWriteVals(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("swFwCancelWrite", 1), ("swFwApplyWrite", 2)) class SwFwTimebase(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5)) namedValues = NamedValues(("swFwTbNone", 1), ("swFwTbSec", 2), ("swFwTbMin", 3), ("swFwTbHour", 4), ("swFwTbDay", 5)) class SwFwStatus(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("disabled", 1), ("enabled", 2)) class SwFwEvent(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7)) namedValues = NamedValues(("started", 1), ("changed", 2), ("exceeded", 3), ("below", 4), ("above", 5), ("inBetween", 6), ("lowBufferCrsd", 7)) class SwFwBehavior(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("triggered", 1), ("continuous", 2)) class SwFwState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("swFwInformative", 1), ("swFwNormal", 2), ("swFwFaulty", 3)) class SwFwLicense(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("swFwLicensed", 1), ("swFwNotLicensed", 2)) swFwFabricWatchLicense = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 1), SwFwLicense()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwFabricWatchLicense.setStatus('current') if mibBuilder.loadTexts: swFwFabricWatchLicense.setDescription('tells if licensed or not.') swFwClassAreaTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2), ) if mibBuilder.loadTexts: swFwClassAreaTable.setStatus('current') if mibBuilder.loadTexts: swFwClassAreaTable.setDescription('The table of classes and areas.') swFwClassAreaEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1), ).setIndexNames((0, "SW-MIB", "swFwClassAreaIndex")) if mibBuilder.loadTexts: swFwClassAreaEntry.setStatus('current') if mibBuilder.loadTexts: swFwClassAreaEntry.setDescription('An entry of the classes and areas.') swFwClassAreaIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 1), SwFwClassesAreas()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwClassAreaIndex.setStatus('current') if mibBuilder.loadTexts: swFwClassAreaIndex.setDescription('This object identifies the class type.') swFwWriteThVals = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 2), SwFwWriteVals()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwWriteThVals.setStatus('current') if mibBuilder.loadTexts: swFwWriteThVals.setDescription('This object is set to apply the value changes.') swFwDefaultUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwDefaultUnit.setStatus('current') if mibBuilder.loadTexts: swFwDefaultUnit.setDescription('A Default unit string name for a threshold area.') swFwDefaultTimebase = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 4), SwFwTimebase()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwDefaultTimebase.setStatus('current') if mibBuilder.loadTexts: swFwDefaultTimebase.setDescription('A Default timebase for the current threshold counter.') swFwDefaultLow = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwDefaultLow.setStatus('current') if mibBuilder.loadTexts: swFwDefaultLow.setDescription('A Default low threshold value.') swFwDefaultHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwDefaultHigh.setStatus('current') if mibBuilder.loadTexts: swFwDefaultHigh.setDescription('A Default high threshold value.') swFwDefaultBufSize = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwDefaultBufSize.setStatus('current') if mibBuilder.loadTexts: swFwDefaultBufSize.setDescription('A Default buffer size value.') swFwCustUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwCustUnit.setStatus('current') if mibBuilder.loadTexts: swFwCustUnit.setDescription('A custom unit string name for a threshold area.') swFwCustTimebase = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 9), SwFwTimebase()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwCustTimebase.setStatus('current') if mibBuilder.loadTexts: swFwCustTimebase.setDescription('A custom timebase for the current threshold counter.') swFwCustLow = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwCustLow.setStatus('current') if mibBuilder.loadTexts: swFwCustLow.setDescription('A custom low threshold value.') swFwCustHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwCustHigh.setStatus('current') if mibBuilder.loadTexts: swFwCustHigh.setDescription('A custom high threshold value.') swFwCustBufSize = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwCustBufSize.setStatus('current') if mibBuilder.loadTexts: swFwCustBufSize.setDescription('A custom buffer size value.') swFwThLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 13), SwFwLevels()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwThLevel.setStatus('current') if mibBuilder.loadTexts: swFwThLevel.setDescription('A level where all the threshold values are set at.') swFwWriteActVals = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 14), SwFwWriteVals()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwWriteActVals.setStatus('current') if mibBuilder.loadTexts: swFwWriteActVals.setDescription('This object is set to apply act value changes.') swFwDefaultChangedActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 15), SwFwActs()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwDefaultChangedActs.setStatus('current') if mibBuilder.loadTexts: swFwDefaultChangedActs.setDescription('Default action matrix for changed event.') swFwDefaultExceededActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 16), SwFwActs()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwDefaultExceededActs.setStatus('current') if mibBuilder.loadTexts: swFwDefaultExceededActs.setDescription('Default action matrix for exceeded event.') swFwDefaultBelowActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 17), SwFwActs()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwDefaultBelowActs.setStatus('current') if mibBuilder.loadTexts: swFwDefaultBelowActs.setDescription('Default action matrix for below event.') swFwDefaultAboveActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 18), SwFwActs()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwDefaultAboveActs.setStatus('current') if mibBuilder.loadTexts: swFwDefaultAboveActs.setDescription('Default action matrix for above event.') swFwDefaultInBetweenActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 19), SwFwActs()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwDefaultInBetweenActs.setStatus('current') if mibBuilder.loadTexts: swFwDefaultInBetweenActs.setDescription('Default action matrix for in-between event.') swFwCustChangedActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 20), SwFwActs()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwCustChangedActs.setStatus('current') if mibBuilder.loadTexts: swFwCustChangedActs.setDescription('custom action matrix for changed event.') swFwCustExceededActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 21), SwFwActs()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwCustExceededActs.setStatus('current') if mibBuilder.loadTexts: swFwCustExceededActs.setDescription('custom action matrix for exceeded event.') swFwCustBelowActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 22), SwFwActs()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwCustBelowActs.setStatus('current') if mibBuilder.loadTexts: swFwCustBelowActs.setDescription('custom action matrix for below event.') swFwCustAboveActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 23), SwFwActs()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwCustAboveActs.setStatus('current') if mibBuilder.loadTexts: swFwCustAboveActs.setDescription('custom action matrix for above event.') swFwCustInBetweenActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 24), SwFwActs()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwCustInBetweenActs.setStatus('current') if mibBuilder.loadTexts: swFwCustInBetweenActs.setDescription('custom action matrix for in-between event.') swFwValidActs = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 25), SwFwActs()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwValidActs.setStatus('current') if mibBuilder.loadTexts: swFwValidActs.setDescription('matrix of valid acts for an class/area.') swFwActLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 26), SwFwLevels()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwActLevel.setStatus('current') if mibBuilder.loadTexts: swFwActLevel.setDescription('A level where all the actions are set at.') swFwThresholdTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3), ) if mibBuilder.loadTexts: swFwThresholdTable.setStatus('current') if mibBuilder.loadTexts: swFwThresholdTable.setDescription('The table of individual thresholds.') swFwThresholdEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1), ).setIndexNames((0, "SW-MIB", "swFwClassAreaIndex"), (0, "SW-MIB", "swFwThresholdIndex")) if mibBuilder.loadTexts: swFwThresholdEntry.setStatus('current') if mibBuilder.loadTexts: swFwThresholdEntry.setDescription('An entry of an individual threshold.') swFwThresholdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwThresholdIndex.setStatus('current') if mibBuilder.loadTexts: swFwThresholdIndex.setDescription('This object identifies the element index of an threshold.') swFwStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 2), SwFwStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwStatus.setStatus('current') if mibBuilder.loadTexts: swFwStatus.setDescription('This object identifies if an threshold is enabled or disabled.') swFwName = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwName.setStatus('current') if mibBuilder.loadTexts: swFwName.setDescription('This object is a name of the threshold.') swFwLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 70))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwLabel.setStatus('current') if mibBuilder.loadTexts: swFwLabel.setDescription('This object is a label of the threshold.') swFwCurVal = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwCurVal.setStatus('current') if mibBuilder.loadTexts: swFwCurVal.setDescription('This object is a current counter of the threshold.') swFwLastEvent = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 6), SwFwEvent()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwLastEvent.setStatus('current') if mibBuilder.loadTexts: swFwLastEvent.setDescription('This object is a last event type of the threshold.') swFwLastEventVal = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwLastEventVal.setStatus('current') if mibBuilder.loadTexts: swFwLastEventVal.setDescription('This object is a last event value of the threshold.') swFwLastEventTime = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwLastEventTime.setStatus('current') if mibBuilder.loadTexts: swFwLastEventTime.setDescription('This object is a last event time of the threshold.') swFwLastState = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 9), SwFwState()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwLastState.setStatus('current') if mibBuilder.loadTexts: swFwLastState.setDescription('This object is a last event state of the threshold.') swFwBehaviorType = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 10), SwFwBehavior()).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwBehaviorType.setStatus('current') if mibBuilder.loadTexts: swFwBehaviorType.setDescription('A behavior of which the thresholds generate event.') swFwBehaviorInt = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: swFwBehaviorInt.setStatus('current') if mibBuilder.loadTexts: swFwBehaviorInt.setDescription('A integer of which the thresholds generate continuous event.') swFwLastSeverityLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 12), SwSevType()).setMaxAccess("readonly") if mibBuilder.loadTexts: swFwLastSeverityLevel.setStatus('current') if mibBuilder.loadTexts: swFwLastSeverityLevel.setDescription('This object is a last event severity level of the threshold.') swEndDeviceRlsTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1), ) if mibBuilder.loadTexts: swEndDeviceRlsTable.setStatus('current') if mibBuilder.loadTexts: swEndDeviceRlsTable.setDescription("The table of individual end devices' rls.") swEndDeviceRlsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1), ).setIndexNames((0, "SW-MIB", "swEndDevicePort"), (0, "SW-MIB", "swEndDeviceAlpa")) if mibBuilder.loadTexts: swEndDeviceRlsEntry.setStatus('current') if mibBuilder.loadTexts: swEndDeviceRlsEntry.setDescription("An entry of an individual end devices' rls.") swEndDevicePort = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))) if mibBuilder.loadTexts: swEndDevicePort.setStatus('current') if mibBuilder.loadTexts: swEndDevicePort.setDescription('This object identifies the port of the end device.') swEndDeviceAlpa = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))) if mibBuilder.loadTexts: swEndDeviceAlpa.setStatus('current') if mibBuilder.loadTexts: swEndDeviceAlpa.setDescription('This object identifies the alpa of the end device.') swEndDevicePortID = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly") if mibBuilder.loadTexts: swEndDevicePortID.setStatus('current') if mibBuilder.loadTexts: swEndDevicePortID.setDescription('The object identifies the Fibre Channel port address ID of the entry.') swEndDeviceLinkFailure = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swEndDeviceLinkFailure.setStatus('current') if mibBuilder.loadTexts: swEndDeviceLinkFailure.setDescription('Link failure count for the end device.') swEndDeviceSyncLoss = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swEndDeviceSyncLoss.setStatus('current') if mibBuilder.loadTexts: swEndDeviceSyncLoss.setDescription('Sync loss count for the end device.') swEndDeviceSigLoss = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swEndDeviceSigLoss.setStatus('current') if mibBuilder.loadTexts: swEndDeviceSigLoss.setDescription('Sig loss count for the end device.') swEndDeviceProtoErr = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swEndDeviceProtoErr.setStatus('current') if mibBuilder.loadTexts: swEndDeviceProtoErr.setDescription('Protocol err count for the end device.') swEndDeviceInvalidWord = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swEndDeviceInvalidWord.setStatus('current') if mibBuilder.loadTexts: swEndDeviceInvalidWord.setDescription('Invalid word count for the end device.') swEndDeviceInvalidCRC = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swEndDeviceInvalidCRC.setStatus('current') if mibBuilder.loadTexts: swEndDeviceInvalidCRC.setDescription('Invalid CRC count for the end device.') swGroupTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 1), ) if mibBuilder.loadTexts: swGroupTable.setStatus('obsolete') if mibBuilder.loadTexts: swGroupTable.setDescription('The table of groups. This may not be available on all versions of Fabric OS.') swGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 1, 1), ).setIndexNames((0, "SW-MIB", "swGroupIndex")) if mibBuilder.loadTexts: swGroupEntry.setStatus('obsolete') if mibBuilder.loadTexts: swGroupEntry.setDescription('An entry of table of groups.') swGroupIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swGroupIndex.setStatus('obsolete') if mibBuilder.loadTexts: swGroupIndex.setDescription('This object is the group index starting from 1.') swGroupName = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: swGroupName.setStatus('obsolete') if mibBuilder.loadTexts: swGroupName.setDescription('This object identifies the name of the group.') swGroupType = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: swGroupType.setStatus('obsolete') if mibBuilder.loadTexts: swGroupType.setDescription('This object identifies the type of the group.') swGroupMemTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 2), ) if mibBuilder.loadTexts: swGroupMemTable.setStatus('obsolete') if mibBuilder.loadTexts: swGroupMemTable.setDescription('The table of members of all groups. This may not be available on all versions of Fabric OS.') swGroupMemEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 2, 1), ).setIndexNames((0, "SW-MIB", "swGroupId"), (0, "SW-MIB", "swGroupMemWwn")) if mibBuilder.loadTexts: swGroupMemEntry.setStatus('obsolete') if mibBuilder.loadTexts: swGroupMemEntry.setDescription('An entry for a member of a group.') swGroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swGroupId.setStatus('obsolete') if mibBuilder.loadTexts: swGroupId.setDescription('This object identifies the Group Id of the member switch.') swGroupMemWwn = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 2, 1, 2), FcWwn()).setMaxAccess("readonly") if mibBuilder.loadTexts: swGroupMemWwn.setStatus('obsolete') if mibBuilder.loadTexts: swGroupMemWwn.setDescription('This object identifies the WWN of the member switch.') swGroupMemPos = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swGroupMemPos.setStatus('obsolete') if mibBuilder.loadTexts: swGroupMemPos.setDescription('This object identifies position of the member switch in the group. This is based on the order that the switches were added in the group.') swBlmPerfALPAMntTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1), ) if mibBuilder.loadTexts: swBlmPerfALPAMntTable.setStatus('current') if mibBuilder.loadTexts: swBlmPerfALPAMntTable.setDescription('ALPA monitoring counter Table. ') swBlmPerfALPAMntEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1, 1), ).setIndexNames((0, "SW-MIB", "swBlmPerfAlpaPort"), (0, "SW-MIB", "swBlmPerfAlpaIndx")) if mibBuilder.loadTexts: swBlmPerfALPAMntEntry.setStatus('current') if mibBuilder.loadTexts: swBlmPerfALPAMntEntry.setDescription(' ALPA monitoring counter for given ALPA.') swBlmPerfAlpaPort = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1, 1, 1), SwPortIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfAlpaPort.setStatus('current') if mibBuilder.loadTexts: swBlmPerfAlpaPort.setDescription(' This Object identifies the port index of the switch.') swBlmPerfAlpaIndx = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 126))).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfAlpaIndx.setStatus('current') if mibBuilder.loadTexts: swBlmPerfAlpaIndx.setDescription(' This Object identifies the ALPA index. There can be 126 ALPA values') swBlmPerfAlpa = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfAlpa.setStatus('current') if mibBuilder.loadTexts: swBlmPerfAlpa.setDescription(" This Object identifies the ALPA values. These values range between x'01' and x'EF'(1 to 239). ALPA value x'00' is reserved for FL_Port If Alpa device is invalid, then it will have -1 value. ") swBlmPerfAlpaCRCCnt = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfAlpaCRCCnt.setStatus('current') if mibBuilder.loadTexts: swBlmPerfAlpaCRCCnt.setDescription('Get CRC count for given ALPA and port. This monitoring provides information on the number of CRC errors occurred on the frames destined to each possible ALPA attached to a specific port.') swBlmPerfEEMntTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2), ) if mibBuilder.loadTexts: swBlmPerfEEMntTable.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEMntTable.setDescription(' End-to-End monitoring counter Table') swBlmPerfEEMntEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1), ).setIndexNames((0, "SW-MIB", "swBlmPerfEEPort"), (0, "SW-MIB", "swBlmPerfEERefKey")) if mibBuilder.loadTexts: swBlmPerfEEMntEntry.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEMntEntry.setDescription('End-to-End monitoring counter for given port.') swBlmPerfEEPort = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 1), SwPortIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfEEPort.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEPort.setDescription(' This object identifies the port number of the switch.') swBlmPerfEERefKey = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfEERefKey.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEERefKey.setDescription('This object identifies the reference number of the counter. This reference is number assigned when a filter is created. In SNMP Index start one instead of 0, add one to actual ref key') swBlmPerfEECRC = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfEECRC.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEECRC.setDescription(' Get End to End CRC error for the frames that matched the SID-DID pair.') swBlmPerfEEFCWRx = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfEEFCWRx.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEFCWRx.setDescription('Get End to End count of Fibre Channel words (FCW), received by the port, that matched the SID-DID pair. ') swBlmPerfEEFCWTx = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfEEFCWTx.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEFCWTx.setDescription('Get End to End count of Fibre Channel words (FCW), transmitted by the port, that matched the SID-DID pair. ') swBlmPerfEESid = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfEESid.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEESid.setDescription(' Gets SID info by reference number. SID (Source Identifier) is a 3-byte field in the frame header used to indicate the address identifier of the N-Port from which the frame was sent.') swBlmPerfEEDid = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfEEDid.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEDid.setDescription('Gets DID info by reference number. DID (Destination Identifier) is a 3-byte field in the frame header used to indicate the address identifier of the N-Port to which the frame was sent.') swBlmPerfFltMntTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3), ) if mibBuilder.loadTexts: swBlmPerfFltMntTable.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltMntTable.setDescription('Filter based monitoring counter.') swBlmPerfFltMntEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3, 1), ).setIndexNames((0, "SW-MIB", "swBlmPerfFltPort"), (0, "SW-MIB", "swBlmPerfFltRefkey")) if mibBuilder.loadTexts: swBlmPerfFltMntEntry.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltMntEntry.setDescription(' Filter base monitoring counter for given port.') swBlmPerfFltPort = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3, 1, 1), SwPortIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfFltPort.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltPort.setDescription('This object identifies the port number of the switch.') swBlmPerfFltRefkey = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfFltRefkey.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltRefkey.setDescription(' This object identifies the reference number of the filter. This reference number is assigned when a filter is created. In SNMP Index start one instead of 0, add one to actual ref key') swBlmPerfFltCnt = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfFltCnt.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltCnt.setDescription('Get statistics of filter based monitor. Filter based monitoring provides information about a filter hit count such as 1. Read command 2. SCSI or IP traffic 3. SCSI Read/Write') swBlmPerfFltAlias = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: swBlmPerfFltAlias.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltAlias.setDescription(' Alias name for the filter.') swSwitchTrunkable = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(8, 0))).clone(namedValues=NamedValues(("yes", 8), ("no", 0)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swSwitchTrunkable.setStatus('current') if mibBuilder.loadTexts: swSwitchTrunkable.setDescription('The trunking status of the switch - whether the switch supports the trunking feature or not. The values are yes(8) - the trunking feature is supported no(0). - the trunking feature is not supported. ') swTrunkTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2), ) if mibBuilder.loadTexts: swTrunkTable.setStatus('current') if mibBuilder.loadTexts: swTrunkTable.setDescription(' Table to display trunking information for the switch. ') swTrunkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2, 1), ).setIndexNames((0, "SW-MIB", "swTrunkPortIndex")) if mibBuilder.loadTexts: swTrunkEntry.setStatus('current') if mibBuilder.loadTexts: swTrunkEntry.setDescription('Entry for the trunking table.') swTrunkPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2, 1, 1), SwPortIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: swTrunkPortIndex.setStatus('current') if mibBuilder.loadTexts: swTrunkPortIndex.setDescription('This object identifies the switch port index. Note that the value of a port index is 1 higher than the port number labeled on the front panel. e.g. port index 1 correspond to port number 0. ') swTrunkGroupNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swTrunkGroupNumber.setStatus('current') if mibBuilder.loadTexts: swTrunkGroupNumber.setDescription('This object is a logical entity which specifies the Group Number to which the port belongs to. If this value is Zero it means the port is not Trunked.') swTrunkMaster = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2, 1, 3), SwTrunkMaster()).setMaxAccess("readonly") if mibBuilder.loadTexts: swTrunkMaster.setStatus('current') if mibBuilder.loadTexts: swTrunkMaster.setDescription('Port number that is the trunk master of the group. The trunk master implicitly defines the group. All ports with the same master are considered to be part of the same group.') swPortTrunked = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swPortTrunked.setStatus('current') if mibBuilder.loadTexts: swPortTrunked.setDescription('The active trunk status for a member port. Values are enabled(1) or disabled(0).') swTrunkGrpTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3), ) if mibBuilder.loadTexts: swTrunkGrpTable.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpTable.setDescription('Table to display trunking Performance information for the switch.') swTrunkGrpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3, 1), ).setIndexNames((0, "SW-MIB", "swTrunkGrpNumber")) if mibBuilder.loadTexts: swTrunkGrpEntry.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpEntry.setDescription('Entry for the trunking Group table.') swTrunkGrpNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: swTrunkGrpNumber.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpNumber.setDescription('This object is a logical entity which specifies the Group Number to which port belongs to.') swTrunkGrpMaster = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3, 1, 2), SwTrunkMaster()).setMaxAccess("readonly") if mibBuilder.loadTexts: swTrunkGrpMaster.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpMaster.setDescription('This object gives the master port id for the TrunkGroup.') swTrunkGrpTx = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swTrunkGrpTx.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpTx.setDescription('Gives the aggregate value of the transmitted words from this TrunkGroup.') swTrunkGrpRx = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swTrunkGrpRx.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpRx.setDescription('Gives the aggregate value of the received words by this TrunkGroup.') swTopTalkerMntMode = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("fabricmode", 1), ("portmode", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swTopTalkerMntMode.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntMode.setDescription('Gives the mode in which toptalker is installed') swTopTalkerMntNumEntries = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: swTopTalkerMntNumEntries.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntNumEntries.setDescription('Gives the number of toptalking flows') swTopTalkerMntTable = MibTable((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3), ) if mibBuilder.loadTexts: swTopTalkerMntTable.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntTable.setDescription('Table to display toptalkingflows') swTopTalkerMntEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1), ).setIndexNames((0, "SW-MIB", "swTopTalkerMntIndex")) if mibBuilder.loadTexts: swTopTalkerMntEntry.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntEntry.setDescription('Entry for the toptalker table') swTopTalkerMntIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: swTopTalkerMntIndex.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntIndex.setDescription('This object identifies the list/object entry') swTopTalkerMntPort = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: swTopTalkerMntPort.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntPort.setDescription('This object identifies the switch port number on which the f-port mode toptalker is added.') swTopTalkerMntSpid = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: swTopTalkerMntSpid.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntSpid.setDescription('This object identifies the SID of the host') swTopTalkerMntDpid = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: swTopTalkerMntDpid.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntDpid.setDescription('This object identifies the DID of the SID-DID pair') swTopTalkerMntflow = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: swTopTalkerMntflow.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntflow.setDescription('This object identifies the traffic flow in MB/sec') swTopTalkerMntSwwn = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 6), FcWwn()).setMaxAccess("readonly") if mibBuilder.loadTexts: swTopTalkerMntSwwn.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntSwwn.setDescription('This object identifies the SID in WWN format of the host') swTopTalkerMntDwwn = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 7), FcWwn()).setMaxAccess("readonly") if mibBuilder.loadTexts: swTopTalkerMntDwwn.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntDwwn.setDescription('This object identifies the DID in WWN format of the SID-DID pair') swCpuUsage = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: swCpuUsage.setStatus('current') if mibBuilder.loadTexts: swCpuUsage.setDescription("System's cpu usage.") swCpuNoOfRetries = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: swCpuNoOfRetries.setStatus('current') if mibBuilder.loadTexts: swCpuNoOfRetries.setDescription('Number of times system should take cpu utilization sample before sending the CPU utilization trap.') swCpuUsageLimit = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: swCpuUsageLimit.setStatus('current') if mibBuilder.loadTexts: swCpuUsageLimit.setDescription('CPU usage limit. If MAPS is enabled, then this object is not supported and return 0 value.') swCpuPollingInterval = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 3600))).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: swCpuPollingInterval.setStatus('current') if mibBuilder.loadTexts: swCpuPollingInterval.setDescription('Time interval between two memory samples.') swCpuAction = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("raslog", 1), ("snmp", 2), ("raslogandSnmp", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swCpuAction.setStatus('current') if mibBuilder.loadTexts: swCpuAction.setDescription('Specifies the actions to be taken if system resources exceed the specified threshold. If MAPS is enabled, then this object is not supported and return 0 value.') swMemUsage = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swMemUsage.setStatus('current') if mibBuilder.loadTexts: swMemUsage.setDescription("System's memory usage.") swMemNoOfRetries = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swMemNoOfRetries.setStatus('current') if mibBuilder.loadTexts: swMemNoOfRetries.setDescription('Number of times system should take memory usage sample before sending the memory usage trap.') swMemUsageLimit = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swMemUsageLimit.setStatus('current') if mibBuilder.loadTexts: swMemUsageLimit.setDescription('Memory usage limit') swMemPollingInterval = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 3600))).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: swMemPollingInterval.setStatus('current') if mibBuilder.loadTexts: swMemPollingInterval.setDescription('Time interval between two memory samples.') swMemAction = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("raslog", 1), ("snmp", 2), ("raslogandSnmp", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swMemAction.setStatus('current') if mibBuilder.loadTexts: swMemAction.setDescription('Specifies the actions to be taken if system resources exceed the specified threshold. If MAPS is enabled, then this object is not supported and return 0 value.') swMemUsageLimit1 = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swMemUsageLimit1.setStatus('current') if mibBuilder.loadTexts: swMemUsageLimit1.setDescription('Low memory usage limit. If MAPS is enabled, then this object is not supported and return 0 value.') swMemUsageLimit3 = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: swMemUsageLimit3.setStatus('current') if mibBuilder.loadTexts: swMemUsageLimit3.setDescription('High memory usage limit. If MAPS is enabled, then this object is not supported and return 0 value.') swConnUnitPortStatEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1), ) connUnitPortStatEntry.registerAugmentions(("SW-MIB", "swConnUnitPortStatEntry")) swConnUnitPortStatEntry.setIndexNames(*connUnitPortStatEntry.getIndexNames()) if mibBuilder.loadTexts: swConnUnitPortStatEntry.setStatus('current') if mibBuilder.loadTexts: swConnUnitPortStatEntry.setDescription('This represents the Conn unit Port Stats') swConnUnitCRCWithBadEOF = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitCRCWithBadEOF.setStatus('current') if mibBuilder.loadTexts: swConnUnitCRCWithBadEOF.setDescription('The number of frames with CRC error with Bad EOF.') swConnUnitZeroTenancy = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitZeroTenancy.setStatus('current') if mibBuilder.loadTexts: swConnUnitZeroTenancy.setDescription('This counter is incremented when the FL_port acquires the loop but does not transmit a frame.') swConnUnitFLNumOfTenancy = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitFLNumOfTenancy.setStatus('current') if mibBuilder.loadTexts: swConnUnitFLNumOfTenancy.setDescription('This counter is incremented when the FL_port acquires the loop.') swConnUnitNLNumOfTenancy = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitNLNumOfTenancy.setStatus('current') if mibBuilder.loadTexts: swConnUnitNLNumOfTenancy.setDescription('This counter is incremented when the NL_port acquires the loop.') swConnUnitStopTenancyStarVation = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitStopTenancyStarVation.setStatus('current') if mibBuilder.loadTexts: swConnUnitStopTenancyStarVation.setDescription('This counter is incremented when the FL_port can not transmit a frame because of lack of credit.') swConnUnitOpend = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitOpend.setStatus('current') if mibBuilder.loadTexts: swConnUnitOpend.setDescription('The number of times FC port entered OPENED state.') swConnUnitTransferConnection = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitTransferConnection.setStatus('current') if mibBuilder.loadTexts: swConnUnitTransferConnection.setDescription('The number of times FC port entered TRANSFER state.') swConnUnitOpen = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitOpen.setStatus('current') if mibBuilder.loadTexts: swConnUnitOpen.setDescription('The number of times FC port entered OPEN state.') swConnUnitInvalidARB = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitInvalidARB.setStatus('current') if mibBuilder.loadTexts: swConnUnitInvalidARB.setDescription('The number of times FC port received invalid ARB.') swConnUnitFTB1Miss = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitFTB1Miss.setStatus('current') if mibBuilder.loadTexts: swConnUnitFTB1Miss.setDescription('This counter is incremented when the port receives a frame with a DID that can not be routed by FCR.. Applicable to 8G platforms only.') swConnUnitFTB2Miss = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitFTB2Miss.setStatus('current') if mibBuilder.loadTexts: swConnUnitFTB2Miss.setDescription('This counter is incremented when the port receives a frame with an SID/DID combination that can not be routed by the VF module.Applicable to 8G platforms only.') swConnUnitFTB6Miss = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitFTB6Miss.setStatus('current') if mibBuilder.loadTexts: swConnUnitFTB6Miss.setDescription('This counter is incremented when port receives a frame with an SID that can not be routed by FCR. Applicable to 8G platforms.') swConnUnitZoneMiss = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitZoneMiss.setStatus('current') if mibBuilder.loadTexts: swConnUnitZoneMiss.setDescription('This counter is incremented when the port receives a frame with an SID and DID that are not zoned together.') swConnUnitLunZoneMiss = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 14), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitLunZoneMiss.setStatus('current') if mibBuilder.loadTexts: swConnUnitLunZoneMiss.setDescription('This counter is incremented when the port receives a frame with an SID, DID and LUN that are not zoned together( This is not currently used ).') swConnUnitBadEOF = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 15), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitBadEOF.setStatus('current') if mibBuilder.loadTexts: swConnUnitBadEOF.setDescription('The number of frames with bad end-of-frame.') swConnUnitLCRX = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 16), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitLCRX.setStatus('current') if mibBuilder.loadTexts: swConnUnitLCRX.setDescription('The number of link control frames received.') swConnUnitRDYPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 17), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitRDYPriority.setStatus('current') if mibBuilder.loadTexts: swConnUnitRDYPriority.setDescription('The number of times that sending R_RDY or VC_RDY primitive signals was a higher priority than sending frames, due to diminishing credit reserves in the transmitter at the other end of the fibre.') swConnUnitLli = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 18), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitLli.setStatus('current') if mibBuilder.loadTexts: swConnUnitLli.setDescription('The number low level interrupts generated by the physical and link layer.') swConnUnitInterrupts = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 19), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitInterrupts.setStatus('current') if mibBuilder.loadTexts: swConnUnitInterrupts.setDescription(' This represents all the interrupts received on a port. Includes LLI, unknown etc') swConnUnitUnknownInterrupts = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 20), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitUnknownInterrupts.setStatus('current') if mibBuilder.loadTexts: swConnUnitUnknownInterrupts.setDescription(' Represents all the unknown interrupts received on a port.') swConnUnitTimedOut = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 21), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitTimedOut.setStatus('current') if mibBuilder.loadTexts: swConnUnitTimedOut.setDescription('Represents number of timed out frames due to any reason.') swConnUnitProcRequired = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 22), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitProcRequired.setStatus('current') if mibBuilder.loadTexts: swConnUnitProcRequired.setDescription('Represents number of frames trapped by CPU.') swConnUnitTxBufferUnavailable = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 23), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitTxBufferUnavailable.setStatus('current') if mibBuilder.loadTexts: swConnUnitTxBufferUnavailable.setDescription('Number of times port failed to transmit frames .') swConnUnitStateChange = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 24), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitStateChange.setStatus('current') if mibBuilder.loadTexts: swConnUnitStateChange.setDescription(' Number of times port has gone to offline, online, and faulty state.') swConnUnitC3DiscardDueToRXTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 25), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitC3DiscardDueToRXTimeout.setStatus('current') if mibBuilder.loadTexts: swConnUnitC3DiscardDueToRXTimeout.setDescription('Number of Class 3 receive frames discarded due to timeout.') swConnUnitC3DiscardDueToDestUnreachable = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 26), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitC3DiscardDueToDestUnreachable.setStatus('current') if mibBuilder.loadTexts: swConnUnitC3DiscardDueToDestUnreachable.setDescription('Number of Class 3 frames discarded due to destination unreachable.') swConnUnitC3DiscardDueToTXTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 27), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitC3DiscardDueToTXTimeout.setStatus('current') if mibBuilder.loadTexts: swConnUnitC3DiscardDueToTXTimeout.setDescription('Number of Class 3 transmit frames discarded due to timeout.') swConnUnitC3DiscardOther = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 28), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitC3DiscardOther.setStatus('current') if mibBuilder.loadTexts: swConnUnitC3DiscardOther.setDescription('Number of Class 3 frames discarded due to unknow reasons.') swConnUnitPCSErrorCounter = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 29), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitPCSErrorCounter.setStatus('current') if mibBuilder.loadTexts: swConnUnitPCSErrorCounter.setDescription('Number of Physical coding sublayer(PCS) block errors. It records the encoding violations on 10G or 16Gbps port.') swConnUnitUnroutableFrameCounter = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 30), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitUnroutableFrameCounter.setStatus('current') if mibBuilder.loadTexts: swConnUnitUnroutableFrameCounter.setDescription('It indicates unroutable frame counter') swConnUnitFECCorrectedCounter = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 31), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitFECCorrectedCounter.setStatus('current') if mibBuilder.loadTexts: swConnUnitFECCorrectedCounter.setDescription('It indicates Forward Error Correction Corrected Blocks count.FEC feature is only applicable to 10G/16G platforms.') swConnUnitFECUnCorrectedCounter = MibTableColumn((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 32), OctetString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readonly") if mibBuilder.loadTexts: swConnUnitFECUnCorrectedCounter.setStatus('current') if mibBuilder.loadTexts: swConnUnitFECUnCorrectedCounter.setDescription('It indicates Forward Error Correction UnCorrected Blocks count.FEC feature is only applicable to 10G/16G platforms.') swTrapsV2 = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0)) if mibBuilder.loadTexts: swTrapsV2.setStatus('current') if mibBuilder.loadTexts: swTrapsV2.setDescription("The Traps for Brocade's Fibre Channel Switch.") swFault = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 1)).setObjects(("SW-MIB", "swDiagResult"), ("SW-MIB", "swSsn")) if mibBuilder.loadTexts: swFault.setStatus('obsolete') if mibBuilder.loadTexts: swFault.setDescription("Obsoleted this trap as firmware doesn't support this trap. A swFault(1) is generated whenever the diagnostics detects a fault with the switch.") swSensorScn = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 2)).setObjects(("SW-MIB", "swSensorStatus"), ("SW-MIB", "swSensorIndex"), ("SW-MIB", "swSensorType"), ("SW-MIB", "swSensorValue"), ("SW-MIB", "swSensorInfo"), ("SW-MIB", "swSsn")) if mibBuilder.loadTexts: swSensorScn.setStatus('current') if mibBuilder.loadTexts: swSensorScn.setDescription('A swSensorScn(2) is generated whenever an environment sensor changes its operational state. For instance, a fan stop working. The VarBind in the Trap Data Unit shall contain the corresponding instance of the sensor status, sensor index, sensor type, sensor value (reading) and sensor information. Note that the sensor information contains the type of sensor and its number in textual format.') swFCPortScn = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 3)).setObjects(("SW-MIB", "swFCPortOpStatus"), ("SW-MIB", "swFCPortIndex"), ("SW-MIB", "swFCPortName"), ("SW-MIB", "swFCPortWwn"), ("SW-MIB", "swFCPortPrevType"), ("SW-MIB", "swFCPortBrcdType"), ("SW-MIB", "swSsn"), ("SW-MIB", "swFCPortFlag"), ("SW-MIB", "swFCPortDisableReason"), ("SW-MIB", "swVfId")) if mibBuilder.loadTexts: swFCPortScn.setStatus('current') if mibBuilder.loadTexts: swFCPortScn.setDescription('This trap is sent whenever an FC port operational status or its type changed. The events that trigger this trap are port goes to online/offline, port type changed to E-port/F-port/FL-port. swFCPortName and swSsn are optional varbind in the trap PDU') swEventTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 4)).setObjects(("SW-MIB", "swEventIndex"), ("SW-MIB", "swEventTimeInfo"), ("SW-MIB", "swEventLevel"), ("SW-MIB", "swEventRepeatCount"), ("SW-MIB", "swEventDescr"), ("SW-MIB", "swSsn"), ("SW-MIB", "swVfId")) if mibBuilder.loadTexts: swEventTrap.setStatus('current') if mibBuilder.loadTexts: swEventTrap.setDescription('This trap is generated when an event whose level at or below swEventTrapLevel occurs.') swFabricWatchTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 5)).setObjects(("SW-MIB", "swFwClassAreaIndex"), ("SW-MIB", "swFwThresholdIndex"), ("SW-MIB", "swFwName"), ("SW-MIB", "swFwLabel"), ("SW-MIB", "swFwLastEventVal"), ("SW-MIB", "swFwLastEventTime"), ("SW-MIB", "swFwLastEvent"), ("SW-MIB", "swFwLastState"), ("SW-MIB", "swFwLastSeverityLevel"), ("SW-MIB", "swSsn"), ("SW-MIB", "swVfId")) if mibBuilder.loadTexts: swFabricWatchTrap.setStatus('current') if mibBuilder.loadTexts: swFabricWatchTrap.setDescription('trap to be sent by Fabric Watch to notify of an event.') swTrackChangesTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 6)).setObjects(("SW-MIB", "swTrackChangesInfo"), ("SW-MIB", "swSsn"), ("SW-MIB", "swVfId")) if mibBuilder.loadTexts: swTrackChangesTrap.setStatus('current') if mibBuilder.loadTexts: swTrackChangesTrap.setDescription('trap to be sent for tracking login/logout/config changes.') swIPv6ChangeTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 7)).setObjects(("SW-MIB", "swIPv6Address"), ("SW-MIB", "swIPv6Status")) if mibBuilder.loadTexts: swIPv6ChangeTrap.setStatus('current') if mibBuilder.loadTexts: swIPv6ChangeTrap.setDescription('This trap is generated when an ipv6 address status change event occurs.') swPmgrEventTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 8)).setObjects(("SW-MIB", "swPmgrEventType"), ("SW-MIB", "swPmgrEventTime"), ("SW-MIB", "swPmgrEventDescr"), ("SW-MIB", "swSsn"), ("SW-MIB", "swVfId")) if mibBuilder.loadTexts: swPmgrEventTrap.setStatus('current') if mibBuilder.loadTexts: swPmgrEventTrap.setDescription('This trap is generated when any partition manager change happens.') swFabricReconfigTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 9)).setObjects(("SW-MIB", "swDomainID")) if mibBuilder.loadTexts: swFabricReconfigTrap.setStatus('current') if mibBuilder.loadTexts: swFabricReconfigTrap.setDescription('trap to be sent for tracking fabric reconfiguration') swFabricSegmentTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 10)).setObjects(("SW-MIB", "swFCPortIndex"), ("SW-MIB", "swFCPortName"), ("SW-MIB", "swSsn"), ("SW-MIB", "swFCPortFlag"), ("SW-MIB", "swVfId")) if mibBuilder.loadTexts: swFabricSegmentTrap.setStatus('current') if mibBuilder.loadTexts: swFabricSegmentTrap.setDescription('trap to be sent for tracking segmentation') swExtTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 11)) if mibBuilder.loadTexts: swExtTrap.setStatus('current') if mibBuilder.loadTexts: swExtTrap.setDescription('THIS IS INTERNAL TRAP') swStateChangeTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 12)).setObjects(("SW-MIB", "swOperStatus"), ("SW-MIB", "swVfId")) if mibBuilder.loadTexts: swStateChangeTrap.setStatus('current') if mibBuilder.loadTexts: swStateChangeTrap.setDescription('This trap is sent whenever switch state changes to online/offline') swPortMoveTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 13)).setObjects(("SW-MIB", "swPortList"), ("SW-MIB", "swVfId")) if mibBuilder.loadTexts: swPortMoveTrap.setStatus('current') if mibBuilder.loadTexts: swPortMoveTrap.setDescription('This trap is sent when ports are moved from one switch to another') swBrcdGenericTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 14)).setObjects(("SW-MIB", "swBrcdTrapBitMask")) if mibBuilder.loadTexts: swBrcdGenericTrap.setStatus('current') if mibBuilder.loadTexts: swBrcdGenericTrap.setDescription("This trap is sent when there is any one of the following event occured. 1. fabric change 2. device change 3. Fapwwn change 4. fdmi event This Trap is strictly for brocade's internal usage.") swDeviceStatusTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 15)).setObjects(("SW-MIB", "swFCPortSpecifier"), ("SW-MIB", "swDeviceStatus"), ("SW-MIB", "swEndDevicePortID"), ("SW-MIB", "swNsNodeName")) if mibBuilder.loadTexts: swDeviceStatusTrap.setStatus('current') if mibBuilder.loadTexts: swDeviceStatusTrap.setDescription('This trap is sent whenever there is a device login or logout') swZoneConfigChangeTrap = NotificationType((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 16)).setObjects(("SW-MIB", "swVfId")) if mibBuilder.loadTexts: swZoneConfigChangeTrap.setStatus('current') if mibBuilder.loadTexts: swZoneConfigChangeTrap.setDescription('This trap is sent whenever there is change in local zone database.') mibBuilder.exportSymbols("SW-MIB", swFwCustUnit=swFwCustUnit, swIDIDMode=swIDIDMode, swSensorValue=swSensorValue, swFabric=swFabric, swTrunkMaster=swTrunkMaster, swDeviceStatusTrap=swDeviceStatusTrap, swTrunkGrpMaster=swTrunkGrpMaster, swFabricMemName=swFabricMemName, swSensorType=swSensorType, sw20x0=sw20x0, swTrunkPortIndex=swTrunkPortIndex, swGroupTable=swGroupTable, swFwClassAreaEntry=swFwClassAreaEntry, swNsWwn=swNsWwn, swBlmPerfEESid=swBlmPerfEESid, swFCPortAdmStatus=swFCPortAdmStatus, swGroupName=swGroupName, swFwValidActs=swFwValidActs, swTrunkGrpNumber=swTrunkGrpNumber, swEventTable=swEventTable, swConnUnitTxBufferUnavailable=swConnUnitTxBufferUnavailable, swFCPortType=swFCPortType, swTrackChangesInfo=swTrackChangesInfo, swTopTalkerMntNumEntries=swTopTalkerMntNumEntries, swFCPortTooManyRdys=swFCPortTooManyRdys, swTopTalkerMntDwwn=swTopTalkerMntDwwn, swSensorInfo=swSensorInfo, swVfName=swVfName, swEventTrapLevel=swEventTrapLevel, swFwDefaultBelowActs=swFwDefaultBelowActs, swGroupEntry=swGroupEntry, swFabricSegmentTrap=swFabricSegmentTrap, swGroup=swGroup, swEndDevicePortID=swEndDevicePortID, SwFwWriteVals=SwFwWriteVals, swFCPortPhyState=swFCPortPhyState, swTopTalkerMntSwwn=swTopTalkerMntSwwn, swTrunkTable=swTrunkTable, swVfId=swVfId, SwFwClassesAreas=SwFwClassesAreas, swSwitchTrunkable=swSwitchTrunkable, swFwCustHigh=swFwCustHigh, swFwLastEventTime=swFwLastEventTime, swFlashDLPassword=swFlashDLPassword, swBlmPerfAlpa=swBlmPerfAlpa, swFCPortMcastTimedOuts=swFCPortMcastTimedOuts, swConnUnitC3DiscardDueToRXTimeout=swConnUnitC3DiscardDueToRXTimeout, swTopTalkerMntflow=swTopTalkerMntflow, swExtTrap=swExtTrap, swFCPortLipIns=swFCPortLipIns, swBlmPerfEEDid=swBlmPerfEEDid, swNsPortName=swNsPortName, PYSNMP_MODULE_ID=swMibModule, swEventIndex=swEventIndex, swNsPortID=swNsPortID, swCpuUsageLimit=swCpuUsageLimit, swPortMoveTrap=swPortMoveTrap, swFwClassAreaTable=swFwClassAreaTable, swFCPortRxBadEofs=swFCPortRxBadEofs, swBlmPerfMnt=swBlmPerfMnt, swFCPortLipLastAlpa=swFCPortLipLastAlpa, swFwSystem=swFwSystem, swBlmPerfFltMntEntry=swBlmPerfFltMntEntry, swFCPortRxCrcs=swFCPortRxCrcs, swTopTalkerMntPort=swTopTalkerMntPort, swEndDeviceSyncLoss=swEndDeviceSyncLoss, swBlmPerfEEPort=swBlmPerfEEPort, swFlashDLFile=swFlashDLFile, swConnUnitUnknownInterrupts=swConnUnitUnknownInterrupts, swNumSensors=swNumSensors, swFlashDLOperStatus=swFlashDLOperStatus, swTopTalkerMntSpid=swTopTalkerMntSpid, swConnUnitC3DiscardDueToDestUnreachable=swConnUnitC3DiscardDueToDestUnreachable, swFault=swFault, swFCPortTable=swFCPortTable, swBlmPerfAlpaPort=swBlmPerfAlpaPort, swFwDefaultUnit=swFwDefaultUnit, swConnUnitLCRX=swConnUnitLCRX, swFCIPMask=swFCIPMask, swConnUnitRDYPriority=swConnUnitRDYPriority, swFCport=swFCport, swConnUnitTransferConnection=swConnUnitTransferConnection, swNsCos=swNsCos, swEventNumEntries=swEventNumEntries, swBlmPerfEERefKey=swBlmPerfEERefKey, swTopTalkerMntMode=swTopTalkerMntMode, swGroupIndex=swGroupIndex, swConnUnitZeroTenancy=swConnUnitZeroTenancy, swFabricWatchTrap=swFabricWatchTrap, swNsIpAddress=swNsIpAddress, swBlmPerfFltMntTable=swBlmPerfFltMntTable, swMemNoOfRetries=swMemNoOfRetries, swNsPortSymb=swNsPortSymb, swNsIpNxPort=swNsIpNxPort, swIPv6ChangeTrap=swIPv6ChangeTrap, swTrunk=swTrunk, swBlmPerfAlpaIndx=swBlmPerfAlpaIndx, swBlmPerfEEMntTable=swBlmPerfEEMntTable, swConnUnitPortStatEntry=swConnUnitPortStatEntry, swEndDevicePort=swEndDevicePort, swFCPortRxC2Frames=swFCPortRxC2Frames, swDomainID=swDomainID, swAdmStatus=swAdmStatus, swGroupMemWwn=swGroupMemWwn, swMemAction=swMemAction, SwFwState=SwFwState, swNbEntry=swNbEntry, swFabricMemEntry=swFabricMemEntry, swFabricMemDid=swFabricMemDid, FcPortFlag=FcPortFlag, swFwCustLow=swFwCustLow, swFCPortSpeed=swFCPortSpeed, swTelnetShellAdmStatus=swTelnetShellAdmStatus, swFwStatus=swFwStatus, swConnUnitUnroutableFrameCounter=swConnUnitUnroutableFrameCounter, swNsEntryIndex=swNsEntryIndex, swFCPortRxFrames=swFCPortRxFrames, swConnUnitBadEOF=swConnUnitBadEOF, swEndDeviceInvalidWord=swEndDeviceInvalidWord, swSensorEntry=swSensorEntry, swConnUnitPCSErrorCounter=swConnUnitPCSErrorCounter, SwFwLicense=SwFwLicense, swSensorStatus=swSensorStatus, swNs=swNs, swMemUsage=swMemUsage, swAgtCmtyIdx=swAgtCmtyIdx, swFwDefaultLow=swFwDefaultLow, swNbMyPort=swNbMyPort, swFCPortIndex=swFCPortIndex, swSsn=swSsn, swConnUnitInvalidARB=swConnUnitInvalidARB, swConnUnitFTB1Miss=swConnUnitFTB1Miss, swNsHardAddr=swNsHardAddr, swEventEntry=swEventEntry, swModel=swModel, swFCIPAddress=swFCIPAddress, swFCPortTxFrames=swFCPortTxFrames, swEndDevice=swEndDevice, swEventVfId=swEventVfId, swFWLastUpdated=swFWLastUpdated, swConnUnitInterrupts=swConnUnitInterrupts, swFwWriteActVals=swFwWriteActVals, swFlashDLAdmStatus=swFlashDLAdmStatus, swEvent=swEvent, swEtherIPMask=swEtherIPMask, SwFwActs=SwFwActs, swFwThLevel=swFwThLevel, swFwCustBelowActs=swFwCustBelowActs, sw=sw, swCpuPollingInterval=swCpuPollingInterval, swBlmPerfFltCnt=swBlmPerfFltCnt, swFwFabricWatchLicense=swFwFabricWatchLicense, swAgtTrapSeverityLevel=swAgtTrapSeverityLevel, swPortTrunked=swPortTrunked, swEventLevel=swEventLevel, swSensorTable=swSensorTable, swPmgrEventTrap=swPmgrEventTrap, swTrunkEntry=swTrunkEntry, swFwLastSeverityLevel=swFwLastSeverityLevel, swNumNbs=swNumNbs, swGroupMemEntry=swGroupMemEntry, SwFwLevels=SwFwLevels, swBlmPerfAlpaCRCCnt=swBlmPerfAlpaCRCCnt, swFlashLastUpdated=swFlashLastUpdated, swZoneConfigChangeTrap=swZoneConfigChangeTrap, swBootPromLastUpdated=swBootPromLastUpdated, swNsLocalEntry=swNsLocalEntry, swFwLastEvent=swFwLastEvent, swFwClassAreaIndex=swFwClassAreaIndex, swBlmPerfEEFCWRx=swBlmPerfEEFCWRx, swConnUnitOpen=swConnUnitOpen, swBlmPerfEEFCWTx=swBlmPerfEEFCWTx, swFwCustAboveActs=swFwCustAboveActs, swNbTable=swNbTable, swNsPortType=swNsPortType, swConnUnitStopTenancyStarVation=swConnUnitStopTenancyStarVation, swFwThresholdEntry=swFwThresholdEntry, swMibModule=swMibModule, swConnUnitFTB2Miss=swConnUnitFTB2Miss, swAgtCmtyStr=swAgtCmtyStr, swFCPortRxC3Frames=swFCPortRxC3Frames, swID=swID, swDeviceStatus=swDeviceStatus, swBlmPerfALPAMntTable=swBlmPerfALPAMntTable, swFCPortCapacity=swFCPortCapacity, swBrcdTrapBitMask=swBrcdTrapBitMask, swNsNodeName=swNsNodeName, swFwBehaviorInt=swFwBehaviorInt, swFCPortBrcdType=swFCPortBrcdType, swFabricMemTable=swFabricMemTable, swFCPortEntry=swFCPortEntry, swTrunkGroupNumber=swTrunkGroupNumber, swTopTalkerMntDpid=swTopTalkerMntDpid, swprivProtocolPassword=swprivProtocolPassword, swFwWriteThVals=swFwWriteThVals, swConnUnitZoneMiss=swConnUnitZoneMiss, swFCPortRxEncOutFrs=swFCPortRxEncOutFrs, swBootDate=swBootDate, swFCPortLipOuts=swFCPortLipOuts, swGroupMemPos=swGroupMemPos, swTrackChangesTrap=swTrackChangesTrap, swConnUnitNLNumOfTenancy=swConnUnitNLNumOfTenancy, swFCPortRxEncInFrs=swFCPortRxEncInFrs, swBeaconAdmStatus=swBeaconAdmStatus, swBlmPerfEEMntEntry=swBlmPerfEEMntEntry, swEventDescr=swEventDescr, swNbIslCost=swNbIslCost, swConnUnitC3DiscardDueToTXTimeout=swConnUnitC3DiscardDueToTXTimeout, swFwCustExceededActs=swFwCustExceededActs, swEventRepeatCount=swEventRepeatCount, swFCPortTxMcasts=swFCPortTxMcasts, swConnUnitOpend=swConnUnitOpend, swOperStatus=swOperStatus, swBlmPerfALPAMntEntry=swBlmPerfALPAMntEntry, swFwDefaultInBetweenActs=swFwDefaultInBetweenActs, sw21kN24k=sw21kN24k, swFwDefaultExceededActs=swFwDefaultExceededActs, swModule=swModule, swBlmPerfEECRC=swBlmPerfEECRC, swNbRemDomain=swNbRemDomain, swCpuOrMemoryUsage=swCpuOrMemoryUsage, swAgtCmtyEntry=swAgtCmtyEntry, swFCPortRxTooLongs=swFCPortRxTooLongs, swIPv6Address=swIPv6Address, swTopTalkerMntEntry=swTopTalkerMntEntry, swFwLastState=swFwLastState, swMemUsageLimit1=swMemUsageLimit1, swTrunkGrpTable=swTrunkGrpTable, swSystem=swSystem, swFwThresholdIndex=swFwThresholdIndex, swPortList=swPortList, swFCPortNoTxCredits=swFCPortNoTxCredits, swFCPortC3Discards=swFCPortC3Discards, swEndDeviceAlpa=swEndDeviceAlpa, swFirmwareVersion=swFirmwareVersion, swGroupType=swGroupType, swEndDeviceSigLoss=swEndDeviceSigLoss, swTrapsV2=swTrapsV2, swMemUsageLimit=swMemUsageLimit, swConnUnitFECCorrectedCounter=swConnUnitFECCorrectedCounter, swTopTalker=swTopTalker, swFabricReconfigTrap=swFabricReconfigTrap, swConnUnitC3DiscardOther=swConnUnitC3DiscardOther, swFlashDLUser=swFlashDLUser, swauthProtocolPassword=swauthProtocolPassword, swCpuNoOfRetries=swCpuNoOfRetries, SwSevType=SwSevType, swFwName=swFwName, swFwDefaultChangedActs=swFwDefaultChangedActs, swFwCustTimebase=swFwCustTimebase, swTrunkGrpEntry=swTrunkGrpEntry, swAgtTrapRcp=swAgtTrapRcp, swCpuUsage=swCpuUsage, swEndDeviceRlsEntry=swEndDeviceRlsEntry) mibBuilder.exportSymbols("SW-MIB", swFwCustInBetweenActs=swFwCustInBetweenActs, swFabricMemWwn=swFabricMemWwn, swFCPortTxWords=swFCPortTxWords, swConnUnitPortStatExtentionTable=swConnUnitPortStatExtentionTable, swConnUnitTimedOut=swConnUnitTimedOut, swTrunkGrpTx=swTrunkGrpTx, swNbIndex=swNbIndex, swNbIslState=swNbIslState, swBlmPerfFltAlias=swBlmPerfFltAlias, swMemPollingInterval=swMemPollingInterval, swIPv6Status=swIPv6Status, swFabricMemType=swFabricMemType, swFwCustBufSize=swFwCustBufSize, swFCPortWwn=swFCPortWwn, swFCPortLinkState=swFCPortLinkState, swEventTrap=swEventTrap, swFCPortFlag=swFCPortFlag, swConnUnitStateChange=swConnUnitStateChange, swFwDefaultBufSize=swFwDefaultBufSize, swNsIPA=swNsIPA, swDiagResult=swDiagResult, swNbBaudRate=swNbBaudRate, swFwDefaultHigh=swFwDefaultHigh, swNsLocalTable=swNsLocalTable, swConnUnitProcRequired=swConnUnitProcRequired, swAgtCfg=swAgtCfg, swFCPortOpStatus=swFCPortOpStatus, swFabricMemGWIP=swFabricMemGWIP, swAgtCmtyTable=swAgtCmtyTable, swFCPortRxLCs=swFCPortRxLCs, swFwCurVal=swFwCurVal, swFabricMemEIP=swFabricMemEIP, swConnUnitLli=swConnUnitLli, swPmgrEventDescr=swPmgrEventDescr, SwFwStatus=SwFwStatus, swTopTalkerMntTable=swTopTalkerMntTable, swGroupMemTable=swGroupMemTable, swPmgrEventType=swPmgrEventType, swFwThresholdTable=swFwThresholdTable, swFabricMemShortVersion=swFabricMemShortVersion, swCpuAction=swCpuAction, swFwBehaviorType=swFwBehaviorType, swFwActLevel=swFwActLevel, swTestString=swTestString, swFCPortRxWords=swFCPortRxWords, swNbRemPort=swNbRemPort, swCurrentDate=swCurrentDate, swFCPortRxTruncs=swFCPortRxTruncs, swStateChangeTrap=swStateChangeTrap, swSensorScn=swSensorScn, swNsLocalNumEntry=swNsLocalNumEntry, swEtherIPAddress=swEtherIPAddress, swFwDefaultAboveActs=swFwDefaultAboveActs, swEndDeviceProtoErr=swEndDeviceProtoErr, swEventTimeInfo=swEventTimeInfo, swConnUnitFTB6Miss=swConnUnitFTB6Miss, swPrincipalSwitch=swPrincipalSwitch, SwFwBehavior=SwFwBehavior, swFwLabel=swFwLabel, swFCPortName=swFCPortName, swEndDeviceLinkFailure=swEndDeviceLinkFailure, swFlashDLHost=swFlashDLHost, swFCPortTxType=swFCPortTxType, swTrunkGrpRx=swTrunkGrpRx, swFwDefaultTimebase=swFwDefaultTimebase, swNsFc4=swNsFc4, swBlmPerfFltRefkey=swBlmPerfFltRefkey, swFCPortRxMcasts=swFCPortRxMcasts, swBrcdGenericTrap=swBrcdGenericTrap, swTopTalkerMntIndex=swTopTalkerMntIndex, swNsNodeSymb=swNsNodeSymb, swBlmPerfFltPort=swBlmPerfFltPort, swFabricMemFCIP=swFabricMemFCIP, swFCPortPrevType=swFCPortPrevType, swMemUsageLimit3=swMemUsageLimit3, swConnUnitFECUnCorrectedCounter=swConnUnitFECUnCorrectedCounter, swPmgrEventTime=swPmgrEventTime, swConnUnitLunZoneMiss=swConnUnitLunZoneMiss, SwFwTimebase=SwFwTimebase, swNbRemPortName=swNbRemPortName, swEndDeviceInvalidCRC=swEndDeviceInvalidCRC, swConnUnitFLNumOfTenancy=swConnUnitFLNumOfTenancy, sw28k=sw28k, swBeaconOperStatus=swBeaconOperStatus, swFCPortScn=swFCPortScn, swFCPortDisableReason=swFCPortDisableReason, swGroupId=swGroupId, swFCPortSpecifier=swFCPortSpecifier, swFCPortRxBadOs=swFCPortRxBadOs, swSensorIndex=swSensorIndex, swFwCustChangedActs=swFwCustChangedActs, SwFwEvent=SwFwEvent, swConnUnitCRCWithBadEOF=swConnUnitCRCWithBadEOF, swEndDeviceRlsTable=swEndDeviceRlsTable, swFwLastEventVal=swFwLastEventVal)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_union, value_range_constraint, constraints_intersection, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint') (fc_switch, bcsi_modules) = mibBuilder.importSymbols('Brocade-REG-MIB', 'fcSwitch', 'bcsiModules') (sw_trunk_master, sw_sensor_index, sw_domain_index, fc_wwn, sw_nb_index, sw_port_index) = mibBuilder.importSymbols('Brocade-TC', 'SwTrunkMaster', 'SwSensorIndex', 'SwDomainIndex', 'FcWwn', 'SwNbIndex', 'SwPortIndex') (conn_unit_port_entry, conn_unit_port_stat_entry) = mibBuilder.importSymbols('FCMGMT-MIB', 'connUnitPortEntry', 'connUnitPortStatEntry') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (bits, unsigned32, integer32, module_identity, notification_type, counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, iso, time_ticks, mib_identifier, counter64, gauge32, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'Unsigned32', 'Integer32', 'ModuleIdentity', 'NotificationType', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'iso', 'TimeTicks', 'MibIdentifier', 'Counter64', 'Gauge32', 'ObjectIdentity') (textual_convention, display_string, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'TruthValue') sw_mib_module = module_identity((1, 3, 6, 1, 4, 1, 1588, 3, 1, 3)) swMibModule.setRevisions(('2003-01-13 14:30', '2003-07-20 14:30', '2004-04-15 10:30', '2004-08-06 18:30', '2005-04-29 20:16', '2006-01-09 09:00', '2006-05-17 09:00', '2007-01-23 09:00', '2007-06-08 12:00', '2007-06-27 10:30', '2007-08-01 12:20', '2007-08-29 04:42', '2008-01-29 07:59', '2008-07-17 03:45', '2008-07-24 02:32', '2008-07-25 02:32', '2008-09-09 09:00', '2009-09-28 09:00', '2009-02-21 09:00', '2009-03-30 09:00', '2009-06-25 12:00', '2009-06-29 01:00', '2009-06-30 13:06', '2009-06-30 06:00', '2009-10-30 05:00', '2009-11-03 13:06', '2009-11-05 12:00', '2009-11-05 05:00', '2009-11-06 11:30', '2009-11-30 10:30', '2009-12-03 17:30', '2010-01-30 17:30', '2010-07-08 11:30', '2010-07-15 11:30', '2010-07-21 11:30', '2010-08-06 11:30', '2010-08-20 10:30', '2010-10-07 10:30', '2010-10-09 10:30', '2010-10-25 10:30', '2010-11-01 06:00', '2010-11-02 10:30', '2010-12-02 10:30', '2010-12-08 10:30', '2010-12-20 10:00', '2010-12-21 04:00', '2010-12-22 10:00', '2010-12-30 10:00', '2011-01-06 10:30', '2011-01-07 10:30', '2011-02-18 06:00', '2012-02-23 10:30', '2012-03-05 03:33', '2012-05-15 14:25', '2012-06-04 17:20', '2012-06-14 10:00', '2012-06-29 15:20', '2012-07-10 16:00', '2012-09-26 14:00', '2013-03-21 13:00', '2013-04-04 17:48', '2013-04-22 11:30', '2013-04-25 18:03', '2013-05-15 14:30', '2013-06-05 16:00', '2013-06-29 10:00', '2013-09-12 10:00', '2013-10-04 13:40')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: swMibModule.setRevisionsDescriptions(('The initial version of this module.', 'Added swIDIDMode to the swFabric group.', 'Added object for Trap Severity Level, swFwLastSeverityLevel. Added the enumeration swFwResourceFlash for SwFwClassesAreas. Deprecated the mib object swEventTrapLevel. Updated the description of swGroupId and corrected the spell mistakes. Obsoleted the swFault Trap. Added enumerations four-GB for swFCPortSpeed and unknown, other for swFCPortType.', 'Added swFCPortSpecifier object to swFCPortTable.', 'Modified the #SUMMARY and #ARGUMENTS for swFabricWatchTrap', '1. Modified the description for swPortTrunked 2. Updated the SW Traps summary and description to remove the obsolete varbindings', 'Added swFCPortFlag object to swFCPortTable', 'Added enumerations eight-GB and ten-GB for swFCPortSpeed', 'Included swFCPortFlag as an additiional variable binding for trap SWFCPortScn', 'Added enumerations octuple and decuple for swNbBaudRate', 'Added the enumerations swFwEPortUtil and swFwEPortPktl for swFwClassAreaIndex', 'Added swFCPortBrcdType object to swFCPortTable', 'Added Toptalker support and swVfId to the swFabric group.', 'Added swIPv6ChangeTrap, swIPv6Address and swIPv6Status .', 'Added swModel to distiguish between 7500 and 7500E switch .', 'Added the enumerations swFwPortLr, swFwEPortLr, swFwEPortUtil, swFwEPortPktl, swFwFCUPortLr, swFwFOPPortLr for swFwClassAreaIndex.', 'Added swPmgrEventTrap information.', 'Added additional fabric watch threshold in SwFwActs.', 'Added port phy states.', 'Added swEventVfId in swEventTable.', "Removed the version information from Brocade's proprietary MIB file name.", 'Modified swVfid position at the last of swFabric table', 'Added swFwCPUMemUsage enumeration under swFwClassAreaIndex.', 'Updated the description of swCpuAction/swMemAction and access of swcpuormemoryusage objects and changed the type of swEndDeviceInvalidWord, swEndDeviceLinkFailure,swEndDeviceSyncLoss, swEndDeviceSigLoss, swEndDeviceProtoErr,swEndDeviceInvalidCRC from integer32 to counter32.', 'Added swFabricReconfigTrap and swFabricSegmentTrap.', 'Removed enum switchReboot from swAdmStatus.', 'Changed swFwCustUnit access to read-only', 'Added enums swFwEPortTrunkUtil,swFwFCUPortTrunkUtil and swFwFOPPortTrunkUtil in SwFwClassesAreas', 'Added swConnUnitExtensionTable and entries for 64 bit portstats.', 'Added swMemUsageLimit1 and swMemUsageLimit3 under swCpuOrMemoryUsage', 'Added swExttrap as internal trap.', 'Changed the descriptions for swConnUnitExtensionTable.', 'Obsoleted swGroupTable, swGroupMemTable from swGroup.', 'Added swFCPortWwn, swFCPortBrcdType in swFcPortScn and added swStateChangeTrap', 'Added trap swPortMoveTrap', 'Added trap portStats objects under SwConnUnitPortStatEntry', 'Added trap swBrcdGenericTrap', 'Added swVfName', 'Added swPortConfigTable', 'Added swFCPortPrevType in swFCPortScn', 'Added fifty filter classes under swFwClassAreaIndex', 'Updated the description of swBrcdTrapBitMask and swBrcdGenericTrap for Fapwwn Trap', 'Deprecated swAgtCmtyTable and provided support of standard mibs SnmpCommunityTable and snmpTargetParamsTable and snmpTargetAddrTable', 'Updated the datatype for swPortEncrypt and swPortCompression', 'Added enumeration sexdecuple for swNbBaudRate', 'Added a new value lowBufferCrsd(7) for swFwLastEvent', 'Changed the area name filter-fmcfg to filterFmCfg in SwFwClassesAreas', 'Included FDMI event case in swBrcdTrapBitMask', 'Added class3 discards error in SwConnUnitPortStatEntry', 'Moved swPortConfigTable, CiperMode and Encrypt/CompressStatus to faext.mib', 'Changed fportmode(2) to portmode(2) for object swTopTalkerMntMode.', 'Added swauthProtocolPassword and swauthProtocolPassword for IBM DirectorServer applications', 'Added new enum noSigDet(14) for object swFCPortPhyState', 'Changed the syntax of swCpuAction and swMemAction objects.', 'Added PCS block errors in swConnUnitPortStatEntry', 'Added swDeviceStatus and swDeviceStatusTrap', 'Added sixteenGB support to swFCPortSpeed and also deprecated teh same', 'Added an area filterFmCfg51 in the class SwFwClassesAreas', 'Removed the tab space and added the space key for swFCPortEntry 38 as this caused a crash in MIB browser', 'Added swFCPortDisableReason in SwFCPortEntry and swFCPortScn trap.', 'Added unroutable frame counter in swConnUnitPortStatEntry', 'Made the swFCPortSpeed obsolete', 'Changed the description for swVFName and swConnUnitPCSErrorCounter', 'Updated swFCPortCapacity description', 'Added swFwPowerOnHours in SwFwClassesAreas', 'Updated the description for swCpuUsageLimit, swCpuAction, swMemAction, swMemUsageLimit1 and swMemUsageLimit3.', 'Added FEC Counters swConnUnitFECCorrectedCounter, swConnUnitFECUnCorrectedCounter', 'Added swZoneConfigChangeTrap')) if mibBuilder.loadTexts: swMibModule.setLastUpdated('201310041340Z') if mibBuilder.loadTexts: swMibModule.setOrganization('Brocade Communications Systems, Inc.,') if mibBuilder.loadTexts: swMibModule.setContactInfo('Customer Support Group Brocade Communications Systems, 1745 Technology Drive, San Jose, CA 95110 U.S.A Tel: +1-408-392-6061 Fax: +1-408-392-6656 Email: support@Brocade.COM WEB: www.brocade.com') if mibBuilder.loadTexts: swMibModule.setDescription("The MIB module is for Brocade's Fibre Channel Switch. Copyright (c) 1996-2003 Brocade Communications Systems, Inc. All rights reserved.") sw = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1)) if mibBuilder.loadTexts: sw.setStatus('current') if mibBuilder.loadTexts: sw.setDescription("The OID sub-tree for Brocade's Silkworm Series of Fibre Channel Switches.") sw28k = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 2)) if mibBuilder.loadTexts: sw28k.setStatus('current') if mibBuilder.loadTexts: sw28k.setDescription("The OID for Brocade's Silkworm 2800 model Fibre Channel Switch.") sw21k_n24k = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 3)) if mibBuilder.loadTexts: sw21kN24k.setStatus('current') if mibBuilder.loadTexts: sw21kN24k.setDescription("The OID for Brocade's Silkworm 2100 and 2400 series model Fibre Channel Switch.") sw20x0 = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 4)) if mibBuilder.loadTexts: sw20x0.setStatus('current') if mibBuilder.loadTexts: sw20x0.setDescription("The OID for Brocade's Silkworm 20x0 series model Fibre Channel Switch.") class Swsevtype(TextualConvention, Integer32): description = "The event trap level in conjunction with the an event's severity level." status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5)) named_values = named_values(('none', 0), ('critical', 1), ('error', 2), ('warning', 3), ('informational', 4), ('debug', 5)) class Fcportflag(TextualConvention, Bits): description = 'Represents the port status for a FC Flag. Currently this will indicate if the port is virtual or physical.' status = 'current' named_values = named_values(('physical', 0), ('virtual', 1)) sw_system = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1)) if mibBuilder.loadTexts: swSystem.setStatus('current') if mibBuilder.loadTexts: swSystem.setDescription('The OID sub-tree for swSystem group.') sw_fabric = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2)) if mibBuilder.loadTexts: swFabric.setStatus('current') if mibBuilder.loadTexts: swFabric.setDescription('The OID sub-tree for swFabric group.') sw_module = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 3)) if mibBuilder.loadTexts: swModule.setStatus('current') if mibBuilder.loadTexts: swModule.setDescription('The OID sub-tree for swModule group.') sw_agt_cfg = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4)) if mibBuilder.loadTexts: swAgtCfg.setStatus('current') if mibBuilder.loadTexts: swAgtCfg.setDescription('The OID sub-tree for swAgtCfg group.') sw_f_cport = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6)) if mibBuilder.loadTexts: swFCport.setStatus('current') if mibBuilder.loadTexts: swFCport.setDescription('The OID sub-tree for swFCport group.') sw_ns = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7)) if mibBuilder.loadTexts: swNs.setStatus('current') if mibBuilder.loadTexts: swNs.setDescription('The OID sub-tree for swNs group.') sw_event = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8)) if mibBuilder.loadTexts: swEvent.setStatus('current') if mibBuilder.loadTexts: swEvent.setDescription('The OID sub-tree for swEvent group.') sw_fw_system = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10)) if mibBuilder.loadTexts: swFwSystem.setStatus('current') if mibBuilder.loadTexts: swFwSystem.setDescription('The OID sub-tree for swFwSystem group.') sw_end_device = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21)) if mibBuilder.loadTexts: swEndDevice.setStatus('current') if mibBuilder.loadTexts: swEndDevice.setDescription('The OID sub-tree for swEndDevice group.') sw_group = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22)) if mibBuilder.loadTexts: swGroup.setStatus('obsolete') if mibBuilder.loadTexts: swGroup.setDescription('The OID sub-tree for swGroup group.') sw_blm_perf_mnt = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23)) if mibBuilder.loadTexts: swBlmPerfMnt.setStatus('current') if mibBuilder.loadTexts: swBlmPerfMnt.setDescription('The OID sub-tree for swBlmPerfMnt (Bloom Performance Monitor) group.') sw_trunk = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24)) if mibBuilder.loadTexts: swTrunk.setStatus('current') if mibBuilder.loadTexts: swTrunk.setDescription('The OID sub-tree for swTrunk group.') sw_top_talker = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25)) if mibBuilder.loadTexts: swTopTalker.setStatus('current') if mibBuilder.loadTexts: swTopTalker.setDescription('The OID sub-tree for TopTalker group.') sw_cpu_or_memory_usage = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26)) if mibBuilder.loadTexts: swCpuOrMemoryUsage.setStatus('current') if mibBuilder.loadTexts: swCpuOrMemoryUsage.setDescription('The OID sub-tree for cpu or memory usage group.') sw_conn_unit_port_stat_extention_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27)) if mibBuilder.loadTexts: swConnUnitPortStatExtentionTable.setStatus('current') if mibBuilder.loadTexts: swConnUnitPortStatExtentionTable.setDescription('This represents the Conn unit Port Stats') sw_current_date = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: swCurrentDate.setStatus('current') if mibBuilder.loadTexts: swCurrentDate.setDescription('The current date information in displayable textual format.') sw_boot_date = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: swBootDate.setStatus('current') if mibBuilder.loadTexts: swBootDate.setDescription('The date and time when the system last booted, in displayable textual format.') sw_fw_last_updated = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFWLastUpdated.setStatus('current') if mibBuilder.loadTexts: swFWLastUpdated.setDescription('The information indicates the date when the firmware was last updated, in displayable textual format.') sw_flash_last_updated = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFlashLastUpdated.setStatus('current') if mibBuilder.loadTexts: swFlashLastUpdated.setDescription('The information indicates the date when the FLASH was last updated, in displayable textual format.') sw_boot_prom_last_updated = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: swBootPromLastUpdated.setStatus('current') if mibBuilder.loadTexts: swBootPromLastUpdated.setDescription('The information indicates the date when the boot PROM was last updated, in displayable textual format.') sw_firmware_version = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 6), display_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFirmwareVersion.setStatus('current') if mibBuilder.loadTexts: swFirmwareVersion.setDescription('The current version of the firwmare.') sw_oper_status = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('online', 1), ('offline', 2), ('testing', 3), ('faulty', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swOperStatus.setStatus('current') if mibBuilder.loadTexts: swOperStatus.setDescription('The current operational status of the switch. The states are as follow: o online(1) means the switch is accessible by an external Fibre Channel port; o offline(2) means the switch is not accessible; o testing(3) means the switch is in a built-in test mode and is not accessible by an external Fibre Channel port; o faulty(4) means the switch is not operational.') sw_adm_status = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('online', 1), ('offline', 2), ('testing', 3), ('faulty', 4), ('reboot', 5), ('fastboot', 6)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swAdmStatus.setStatus('current') if mibBuilder.loadTexts: swAdmStatus.setDescription("The desired administrative status of the switch. A management station may place the switch in a desired state by setting this object accordingly. The states are as follow: o online(1) means set the switch to be accessible by an external Fibre Channel port; o offline(2) means set the switch to be inaccessible; o testing(3) means set the switch to run the built-in test; o faulty(4) means set the switch to a 'soft' faulty condition; o reboot(5) means set the switch to reboot in 1 second. o fastboot(6) means set the switch to fastboot in 1 second. Fastboot would cause the switch to boot but skip over the POST. When the switch is in faulty state, only two states can be set: faulty and reboot/fastboot.") sw_telnet_shell_adm_status = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('unknown', 0), ('terminated', 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swTelnetShellAdmStatus.setStatus('current') if mibBuilder.loadTexts: swTelnetShellAdmStatus.setDescription('The desired administrative status of the Telnet shell. By setting it to terminated(1), the current Telnet shell task is deleted. When this variable instance is read, it reports the value last set through SNMP.') sw_ssn = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 10), display_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: swSsn.setStatus('current') if mibBuilder.loadTexts: swSsn.setDescription('The soft serial number of the switch.') sw_flash_dl_oper_status = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('unknown', 0), ('swCurrent', 1), ('swFwUpgraded', 2), ('swCfUploaded', 3), ('swCfDownloaded', 4), ('swFwCorrupted', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFlashDLOperStatus.setStatus('current') if mibBuilder.loadTexts: swFlashDLOperStatus.setDescription('The operational status of the FLASH. The operational states are as follow: o swCurrent(1) indicates that the FLASH contains the current firmware image or config file; o swFwUpgraded(2) state indicates that it contains the image upgraded from the swFlashDLHost.0.; o swCfUploaded(3) state indicates that the switch configuration file has been uploaded to the host; and o swCfDownloaded(4) state indicates that the switch configuration file has been downloaded from the host. o swFwCorrupted (5) state indicates that the firmware in the FLASH of the switch is corrupted.') sw_flash_dl_adm_status = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('swCurrent', 1), ('swFwUpgrade', 2), ('swCfUpload', 3), ('swCfDownload', 4), ('swFwCorrupted', 5)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFlashDLAdmStatus.setStatus('current') if mibBuilder.loadTexts: swFlashDLAdmStatus.setDescription('The desired state of the FLASH. A management station may place the FLASH in a desired state by setting this object accordingly: o swCurrent(1) indicates that the FLASH contains the current firmware image or config file; o swFwUpgrade(2) means that the firmware in the FLASH is to be upgraded from the host specified; o swCfUpload(3) means that the switch config file is to be uploaded to the host specified; or o swCfDownload(4) means that the switch config file is to be downloaded from the host specified. o swFwCorrupted(5) state indicates that the firmware in the FLASH is corrupted. This value is for informational purpose only. However, set of swFlashDLAdmStatus to this value is not allowed. The host is specified in swFlashDLHost.0. In addition, user name is specified in swFlashDLUser.0, and the file name specified in swFlashDLFile.0. Reference the user manual on the following commands, o firmwareDownload, o configUpload, and o configDownload.') sw_flash_dl_host = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 13), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFlashDLHost.setStatus('current') if mibBuilder.loadTexts: swFlashDLHost.setDescription('The name or IP address (in dot notation) of the host to download or upload a relevant file to the FLASH.') sw_flash_dl_user = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 14), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFlashDLUser.setStatus('current') if mibBuilder.loadTexts: swFlashDLUser.setDescription('The user name on the host to download or upload a relevant file to or from the FLASH.') sw_flash_dl_file = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 15), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFlashDLFile.setStatus('current') if mibBuilder.loadTexts: swFlashDLFile.setDescription('The name of the file to be downloaded or uploaded.') sw_flash_dl_password = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 16), display_string().subtype(subtypeSpec=value_size_constraint(0, 100))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFlashDLPassword.setStatus('current') if mibBuilder.loadTexts: swFlashDLPassword.setDescription('The password to be used in for FTP transfer of files in the download or upload operation.') sw_beacon_oper_status = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('on', 1), ('off', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swBeaconOperStatus.setStatus('current') if mibBuilder.loadTexts: swBeaconOperStatus.setDescription('The current operational status of the switch beacon. When the beacon is on, the LEDs on the front panel of the switch run alternately from left to right and right to left. The color is yellow. When the beacon is off, each LED will be in their its regular status indicating color and state.') sw_beacon_adm_status = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('on', 1), ('off', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swBeaconAdmStatus.setStatus('current') if mibBuilder.loadTexts: swBeaconAdmStatus.setDescription('The desired status of the switch beacon. When the beacon is set to on, the LEDs on the front panel of the switch run alternately from left to right and right to left. The color is yellow. When the beacon is set to off, each LED will be in its regular status indicating color and state.') sw_diag_result = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('sw-ok', 1), ('sw-faulty', 2), ('sw-embedded-port-fault', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swDiagResult.setStatus('current') if mibBuilder.loadTexts: swDiagResult.setDescription('The result of the power-on startup (POST) diagnostics.') sw_num_sensors = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 21), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swNumSensors.setStatus('current') if mibBuilder.loadTexts: swNumSensors.setDescription('The number of sensors inside the switch.') sw_sensor_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22)) if mibBuilder.loadTexts: swSensorTable.setStatus('current') if mibBuilder.loadTexts: swSensorTable.setDescription('The table of sensor entries.') sw_sensor_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1)).setIndexNames((0, 'SW-MIB', 'swSensorIndex')) if mibBuilder.loadTexts: swSensorEntry.setStatus('current') if mibBuilder.loadTexts: swSensorEntry.setDescription('An entry of the sensor information.') sw_sensor_index = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1, 1), sw_sensor_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swSensorIndex.setStatus('current') if mibBuilder.loadTexts: swSensorIndex.setDescription('This object identifies the sensor.') sw_sensor_type = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('temperature', 1), ('fan', 2), ('power-supply', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swSensorType.setStatus('current') if mibBuilder.loadTexts: swSensorType.setDescription('This object identifies the sensor type.') sw_sensor_status = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('unknown', 1), ('faulty', 2), ('below-min', 3), ('nominal', 4), ('above-max', 5), ('absent', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swSensorStatus.setStatus('current') if mibBuilder.loadTexts: swSensorStatus.setDescription('The current status of the sensor.') sw_sensor_value = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swSensorValue.setStatus('current') if mibBuilder.loadTexts: swSensorValue.setDescription('The current value (reading) of the sensor. The value, -2147483648, represents an unknown quantity. It also means that the sensor does not have the capability to measure the actual value. In V2.0, the temperature sensor value will be in Celsius; the fan value will be in RPM (revolution per minute); and the power supply sensor reading will be unknown.') sw_sensor_info = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 22, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swSensorInfo.setStatus('current') if mibBuilder.loadTexts: swSensorInfo.setDescription("Additional displayable information on the sensor. In V2.x, it contains the sensor type and number in textual format. For example, 'Temp 3', 'Fan 6'.") sw_track_changes_info = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 23), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: swTrackChangesInfo.setStatus('current') if mibBuilder.loadTexts: swTrackChangesInfo.setDescription('Track changes string. For trap only') sw_id = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 24), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swID.setStatus('current') if mibBuilder.loadTexts: swID.setDescription('The number of the logical switch (0/1)') sw_ether_ip_address = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 25), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: swEtherIPAddress.setStatus('current') if mibBuilder.loadTexts: swEtherIPAddress.setDescription('The IP Address of the Ethernet interface of this logical switch.') sw_ether_ip_mask = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 26), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: swEtherIPMask.setStatus('current') if mibBuilder.loadTexts: swEtherIPMask.setDescription('The IP Mask of the Ethernet interface of this logical switch.') sw_fcip_address = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 27), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCIPAddress.setStatus('current') if mibBuilder.loadTexts: swFCIPAddress.setDescription('The IP Address of the FC interface of this logical switch.') sw_fcip_mask = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 28), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCIPMask.setStatus('current') if mibBuilder.loadTexts: swFCIPMask.setDescription('The IP Mask of the FC interface of this logical switch.') sw_i_pv6_address = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 29), display_string()) if mibBuilder.loadTexts: swIPv6Address.setStatus('current') if mibBuilder.loadTexts: swIPv6Address.setDescription('IPV6 address.') sw_i_pv6_status = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 30), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('tentative', 1), ('preferred', 2), ('ipdeprecated', 3), ('inactive', 4)))) if mibBuilder.loadTexts: swIPv6Status.setStatus('current') if mibBuilder.loadTexts: swIPv6Status.setDescription('The current status of ipv6 address.') sw_model = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 31), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('switch7500', 1), ('switch7500E', 2), ('other', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swModel.setStatus('current') if mibBuilder.loadTexts: swModel.setDescription('Indicates whether the switch is 7500 or 7500E .') sw_test_string = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 32), display_string().subtype(subtypeSpec=value_size_constraint(1, 255))) if mibBuilder.loadTexts: swTestString.setStatus('current') if mibBuilder.loadTexts: swTestString.setDescription('presence of this string represents test trap.') sw_port_list = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 33), octet_string()) if mibBuilder.loadTexts: swPortList.setStatus('current') if mibBuilder.loadTexts: swPortList.setDescription('This string represents the list of ports and its WWN when ports moved from one switch to another.') sw_brcd_trap_bit_mask = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 34), integer32()) if mibBuilder.loadTexts: swBrcdTrapBitMask.setStatus('current') if mibBuilder.loadTexts: swBrcdTrapBitMask.setDescription('Type of notification will be represented by a single bit in this variable. 0x01 - Fabric change event 0x02 - Device change event 0x04 - Fapwwn change event 0x08 - FDMI events.') sw_fc_port_prev_type = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 35), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('unknown', 1), ('other', 2), ('fl-port', 3), ('f-port', 4), ('e-port', 5), ('g-port', 6), ('ex-port', 7)))) if mibBuilder.loadTexts: swFCPortPrevType.setStatus('current') if mibBuilder.loadTexts: swFCPortPrevType.setDescription('This represents port type of a port before it goes online/offline and it is valid only in swFcPortSCN trap') sw_device_status = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 1, 36), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('login', 1), ('logout', 2), ('unknown', 3)))) if mibBuilder.loadTexts: swDeviceStatus.setStatus('current') if mibBuilder.loadTexts: swDeviceStatus.setDescription('This represents the attached device status. The status will change whenever port/node goes to online/offline') sw_domain_id = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 1), sw_domain_index()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swDomainID.setStatus('current') if mibBuilder.loadTexts: swDomainID.setDescription('The current Fibre Channel domain ID of the switch. To set a new value, the switch (swAdmStatus) must be in offline or testing state.') sw_principal_switch = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('yes', 1), ('no', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swPrincipalSwitch.setStatus('current') if mibBuilder.loadTexts: swPrincipalSwitch.setDescription('This object indicates whether the switch is the Principal switch as per FC-SW.') sw_num_nbs = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swNumNbs.setStatus('current') if mibBuilder.loadTexts: swNumNbs.setDescription('The number of Inter-Switch Links in the (immediate) neighborhood.') sw_nb_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9)) if mibBuilder.loadTexts: swNbTable.setStatus('current') if mibBuilder.loadTexts: swNbTable.setDescription('This table contains the ISLs in the immediate neighborhood of the switch.') sw_nb_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1)).setIndexNames((0, 'SW-MIB', 'swNbIndex')) if mibBuilder.loadTexts: swNbEntry.setStatus('current') if mibBuilder.loadTexts: swNbEntry.setDescription('An entry containing each neighbor ISL parameters.') sw_nb_index = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 1), sw_nb_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swNbIndex.setStatus('current') if mibBuilder.loadTexts: swNbIndex.setDescription('This object identifies the neighbor ISL entry.') sw_nb_my_port = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 2), sw_port_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swNbMyPort.setStatus('current') if mibBuilder.loadTexts: swNbMyPort.setDescription('This is the port that has an ISL to another switch.') sw_nb_rem_domain = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 3), sw_domain_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swNbRemDomain.setStatus('current') if mibBuilder.loadTexts: swNbRemDomain.setDescription('This is the Fibre Channel domain on the other end of the ISL.') sw_nb_rem_port = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 4), sw_port_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swNbRemPort.setStatus('current') if mibBuilder.loadTexts: swNbRemPort.setDescription('This is the port index on the other end of the ISL.') sw_nb_baud_rate = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 4, 8, 16, 32, 64, 128, 256, 512))).clone(namedValues=named_values(('other', 1), ('oneEighth', 2), ('quarter', 4), ('half', 8), ('full', 16), ('double', 32), ('quadruple', 64), ('octuple', 128), ('decuple', 256), ('sexdecuple', 512)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swNbBaudRate.setStatus('current') if mibBuilder.loadTexts: swNbBaudRate.setDescription('The baud rate of the ISL.') sw_nb_isl_state = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('sw-down', 0), ('sw-init', 1), ('sw-internal2', 2), ('sw-internal3', 3), ('sw-internal4', 4), ('sw-active', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swNbIslState.setStatus('current') if mibBuilder.loadTexts: swNbIslState.setDescription('The current state of the ISL. The swNbIslState will be 0 when ISL is in incompatible state or port is a slave port.') sw_nb_isl_cost = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swNbIslCost.setStatus('current') if mibBuilder.loadTexts: swNbIslCost.setDescription('The current link cost of the ISL.') sw_nb_rem_port_name = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 9, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swNbRemPortName.setStatus('current') if mibBuilder.loadTexts: swNbRemPortName.setDescription('The World_wide_Name of the remote port.') sw_fabric_mem_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10)) if mibBuilder.loadTexts: swFabricMemTable.setStatus('current') if mibBuilder.loadTexts: swFabricMemTable.setDescription('This table contains information on the member switches of a fabric. This may not be available on all versions of Fabric OS.') sw_fabric_mem_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1)).setIndexNames((0, 'SW-MIB', 'swFabricMemWwn')) if mibBuilder.loadTexts: swFabricMemEntry.setStatus('current') if mibBuilder.loadTexts: swFabricMemEntry.setDescription('An entry containing each switch in the fabric.') sw_fabric_mem_wwn = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 1), fc_wwn()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFabricMemWwn.setStatus('current') if mibBuilder.loadTexts: swFabricMemWwn.setDescription('This object identifies the World wide name of the member switch.') sw_fabric_mem_did = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 2), sw_domain_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFabricMemDid.setStatus('current') if mibBuilder.loadTexts: swFabricMemDid.setDescription('This object identifies the domain id of the member switch.') sw_fabric_mem_name = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFabricMemName.setStatus('current') if mibBuilder.loadTexts: swFabricMemName.setDescription('This object identifies the name of the member switch.') sw_fabric_mem_eip = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 4), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFabricMemEIP.setStatus('current') if mibBuilder.loadTexts: swFabricMemEIP.setDescription('This object identifies the ethernet IP address of the member switch.') sw_fabric_mem_fcip = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 5), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFabricMemFCIP.setStatus('current') if mibBuilder.loadTexts: swFabricMemFCIP.setDescription('This object identifies the Fibre Channel IP address of the member switch.') sw_fabric_mem_gwip = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 6), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFabricMemGWIP.setStatus('current') if mibBuilder.loadTexts: swFabricMemGWIP.setDescription('This object identifies the Gateway IP address of the member switch.') sw_fabric_mem_type = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFabricMemType.setStatus('current') if mibBuilder.loadTexts: swFabricMemType.setDescription('This object identifies the member switch type.') sw_fabric_mem_short_version = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 10, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(0, 24))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFabricMemShortVersion.setStatus('current') if mibBuilder.loadTexts: swFabricMemShortVersion.setDescription('This object identifies Fabric OS version of the member switch.') sw_idid_mode = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swIDIDMode.setStatus('current') if mibBuilder.loadTexts: swIDIDMode.setDescription('Status of Insistent Domain ID (IDID) mode. Status indicating IDID mode is enabled or not.') sw_pmgr_event_type = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 6))).clone(namedValues=named_values(('create', 0), ('delete', 1), ('moveport', 2), ('fidchange', 3), ('basechange', 4), ('vfstatechange', 6)))) if mibBuilder.loadTexts: swPmgrEventType.setStatus('current') if mibBuilder.loadTexts: swPmgrEventType.setDescription('Indicates Partition manager event type.') sw_pmgr_event_time = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 13), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))) if mibBuilder.loadTexts: swPmgrEventTime.setStatus('current') if mibBuilder.loadTexts: swPmgrEventTime.setDescription('This object identifies the date and time when this pmgr event occurred, in textual format.') sw_pmgr_event_descr = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 14), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))) if mibBuilder.loadTexts: swPmgrEventDescr.setStatus('current') if mibBuilder.loadTexts: swPmgrEventDescr.setDescription('This object identifies the textual description of the pmgr event.') sw_vf_id = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swVfId.setStatus('current') if mibBuilder.loadTexts: swVfId.setDescription('The Virtual fabric id.') sw_vf_name = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 2, 16), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: swVfName.setStatus('current') if mibBuilder.loadTexts: swVfName.setDescription('This represents the virtual fabric name configured in the switch') sw_agt_cmty_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11)) if mibBuilder.loadTexts: swAgtCmtyTable.setStatus('deprecated') if mibBuilder.loadTexts: swAgtCmtyTable.setDescription('A table that contains, one entry for each Community, the access control and parameters of the Community.') swauth_protocol_password = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 12), octet_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swauthProtocolPassword.setStatus('current') if mibBuilder.loadTexts: swauthProtocolPassword.setDescription('This entry is created specific to the Pharos switch to change the password for the auth protocol to reserved user DirectorServerSNMPv3User') swpriv_protocol_password = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 13), octet_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swprivProtocolPassword.setStatus('current') if mibBuilder.loadTexts: swprivProtocolPassword.setDescription('This entry is created specific to the Pharos switch to change the password for the priv protocol to reserved user DirectorServerSNMPv3User') sw_agt_cmty_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11, 1)).setIndexNames((0, 'SW-MIB', 'swAgtCmtyIdx')) if mibBuilder.loadTexts: swAgtCmtyEntry.setStatus('deprecated') if mibBuilder.loadTexts: swAgtCmtyEntry.setDescription('An entry containing the Community parameters.') sw_agt_cmty_idx = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: swAgtCmtyIdx.setStatus('deprecated') if mibBuilder.loadTexts: swAgtCmtyIdx.setDescription('This object identifies the SNMPv1 Community entry.') sw_agt_cmty_str = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(2, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swAgtCmtyStr.setStatus('deprecated') if mibBuilder.loadTexts: swAgtCmtyStr.setDescription('This is a Community string supported by the agent. If a new value is set successfully, it takes effect immediately.') sw_agt_trap_rcp = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swAgtTrapRcp.setStatus('deprecated') if mibBuilder.loadTexts: swAgtTrapRcp.setDescription('This is the trap recipient associated with the Community. If a new value is set successfully, it takes effect immediately.') sw_agt_trap_severity_level = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 4, 11, 1, 4), sw_sev_type()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swAgtTrapSeverityLevel.setStatus('deprecated') if mibBuilder.loadTexts: swAgtTrapSeverityLevel.setDescription("This is the trap severity level associated with the swAgtTrapRcp. The trap severity level in conjunction with the an event's severity level. When an event occurs and if its severity level is at or below the set value, the SNMP trap is sent to configured trap recipients. The severity level is limited to particular events. If a new value is set successfully, it takes effect immediately.") sw_fc_port_capacity = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortCapacity.setStatus('current') if mibBuilder.loadTexts: swFCPortCapacity.setDescription('The maximum number of of physical ports on the switch. This will include ports of the protocol: FC, FCIP(GE ports), VE(FCIP)...') sw_fc_port_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2)) if mibBuilder.loadTexts: swFCPortTable.setStatus('current') if mibBuilder.loadTexts: swFCPortTable.setDescription('A table that contains, one entry for each switch port, configuration and service parameters of the port.') sw_fc_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1)).setIndexNames((0, 'SW-MIB', 'swFCPortIndex')) if mibBuilder.loadTexts: swFCPortEntry.setStatus('current') if mibBuilder.loadTexts: swFCPortEntry.setDescription('An entry containing the configuration and service parameters of the switch port.') sw_fc_port_index = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 1), sw_port_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortIndex.setStatus('current') if mibBuilder.loadTexts: swFCPortIndex.setDescription('This object identifies the switch port index. Note that the value of a port index is 1 higher than the port number labeled on the front panel. E.g. port index 1 correspond to port number 0.') sw_fc_port_type = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('stitch', 1), ('flannel', 2), ('loom', 3), ('bloom', 4), ('rdbloom', 5), ('wormhole', 6), ('other', 7), ('unknown', 8)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortType.setStatus('current') if mibBuilder.loadTexts: swFCPortType.setDescription('This object identifies the type of switch port. It may be of type stitch(1), flannel(2), loom(3) , bloom(4),rdbloom(5) or wormhole(6).') sw_fc_port_phy_state = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 255))).clone(namedValues=named_values(('noCard', 1), ('noTransceiver', 2), ('laserFault', 3), ('noLight', 4), ('noSync', 5), ('inSync', 6), ('portFault', 7), ('diagFault', 8), ('lockRef', 9), ('validating', 10), ('invalidModule', 11), ('noSigDet', 14), ('unknown', 255)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortPhyState.setStatus('current') if mibBuilder.loadTexts: swFCPortPhyState.setDescription('This object identifies the physical state of the port: noCard(1) no card present in this switch slot; noTransceiver(2) no Transceiver module in this port. noGbic(2) was used previously. Transceiver is the generic name for GBIC, SFP etc.; laserFault(3) the module is signaling a laser fault (defective Transceiver); noLight(4) the module is not receiving light; noSync(5) the module is receiving light but is out of sync; inSync(6) the module is receiving light and is in sync; portFault(7) the port is marked faulty (defective Transceiver, cable or device); diagFault(8) the port failed diagnostics (defective G_Port or FL_Port card or motherboard); lockRef(9) the port is locking to the reference signal. validating(10) Validation is in progress invalidModule(11) Invalid SFP unknown(255) unknown. ') sw_fc_port_op_status = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4))).clone(namedValues=named_values(('unknown', 0), ('online', 1), ('offline', 2), ('testing', 3), ('faulty', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortOpStatus.setStatus('current') if mibBuilder.loadTexts: swFCPortOpStatus.setDescription('This object identifies the operational status of the port. The online(1) state indicates that user frames can be passed. The unknown(0) state indicates that likely the port module is physically absent (see swFCPortPhyState).') sw_fc_port_adm_status = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('online', 1), ('offline', 2), ('testing', 3), ('faulty', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFCPortAdmStatus.setStatus('current') if mibBuilder.loadTexts: swFCPortAdmStatus.setDescription('The desired state of the port. A management station may place the port in a desired state by setting this object accordingly. The testing(3) state indicates that no user frames can be passed. As the result of either explicit management action or per configuration information accessible by the switch, swFCPortAdmStatus is then changed to either the online(1) or testing(3) states, or remains in the offline(2) state.') sw_fc_port_link_state = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2), ('loopback', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFCPortLinkState.setStatus('current') if mibBuilder.loadTexts: swFCPortLinkState.setDescription("This object indicates the link state of the port. The value may be: enabled(1) - port is allowed to participate in the FC-PH protocol with its attached port (or ports if it is in a FC-AL loop); disabled(2) - the port is not allowed to participate in the FC-PH protocol with its attached port(s); loopback(3) - the port may transmit frames through an internal path to verify the health of the transmitter and receiver path. Note that when the port's link state changes, its operational status (swFCPortOpStatus) will be affected.") sw_fc_port_tx_type = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('unknown', 1), ('lw', 2), ('sw', 3), ('ld', 4), ('cu', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortTxType.setStatus('current') if mibBuilder.loadTexts: swFCPortTxType.setDescription('This object indicates the media transmitter type of the port. The value may be: unknown(1) cannot determined to the port driver lw(2) long wave laser sw(3) short wave laser ld(4) long wave LED cu(5) copper (electrical).') sw_fc_port_tx_words = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortTxWords.setStatus('current') if mibBuilder.loadTexts: swFCPortTxWords.setDescription('This object counts the number of Fibre Channel words that the port has transmitted.') sw_fc_port_rx_words = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxWords.setStatus('current') if mibBuilder.loadTexts: swFCPortRxWords.setDescription('This object counts the number of Fibre Channel words that the port has received.') sw_fc_port_tx_frames = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortTxFrames.setStatus('current') if mibBuilder.loadTexts: swFCPortTxFrames.setDescription('This object counts the number of (Fibre Channel) frames that the port has transmitted.') sw_fc_port_rx_frames = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxFrames.setStatus('current') if mibBuilder.loadTexts: swFCPortRxFrames.setDescription('This object counts the number of (Fibre Channel) frames that the port has received.') sw_fc_port_rx_c2_frames = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxC2Frames.setStatus('current') if mibBuilder.loadTexts: swFCPortRxC2Frames.setDescription('This object counts the number of Class 2 frames that the port has received.') sw_fc_port_rx_c3_frames = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxC3Frames.setStatus('current') if mibBuilder.loadTexts: swFCPortRxC3Frames.setDescription('This object counts the number of Class 3 frames that the port has received.') sw_fc_port_rx_l_cs = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxLCs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxLCs.setDescription('This object counts the number of Link Control frames that the port has received.') sw_fc_port_rx_mcasts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxMcasts.setStatus('current') if mibBuilder.loadTexts: swFCPortRxMcasts.setDescription('This object counts the number of Multicast frames that the port has received.') sw_fc_port_too_many_rdys = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortTooManyRdys.setStatus('current') if mibBuilder.loadTexts: swFCPortTooManyRdys.setDescription('This object counts the number of times when RDYs exceeds the frames received.') sw_fc_port_no_tx_credits = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortNoTxCredits.setStatus('current') if mibBuilder.loadTexts: swFCPortNoTxCredits.setDescription('This object counts the number of times when the transmit credit has reached zero.') sw_fc_port_rx_enc_in_frs = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxEncInFrs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxEncInFrs.setDescription('This object counts the number of encoding error or disparity error inside frames received.') sw_fc_port_rx_crcs = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxCrcs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxCrcs.setDescription('This object counts the number of CRC errors detected for frames received.') sw_fc_port_rx_truncs = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 23), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxTruncs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxTruncs.setDescription('This object counts the number of truncated frames that the port has received.') sw_fc_port_rx_too_longs = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 24), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxTooLongs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxTooLongs.setDescription('This object counts the number of received frames that are too long.') sw_fc_port_rx_bad_eofs = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 25), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxBadEofs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxBadEofs.setDescription('This object counts the number of received frames that have bad EOF delimiter.') sw_fc_port_rx_enc_out_frs = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 26), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxEncOutFrs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxEncOutFrs.setDescription('This object counts the number of encoding error or disparity error outside frames received.') sw_fc_port_rx_bad_os = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 27), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortRxBadOs.setStatus('current') if mibBuilder.loadTexts: swFCPortRxBadOs.setDescription('This object counts the number of invalid Ordered Sets received.') sw_fc_port_c3_discards = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 28), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortC3Discards.setStatus('current') if mibBuilder.loadTexts: swFCPortC3Discards.setDescription('This object counts the number of Class 3 frames that the port has discarded.') sw_fc_port_mcast_timed_outs = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 29), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortMcastTimedOuts.setStatus('current') if mibBuilder.loadTexts: swFCPortMcastTimedOuts.setDescription('This object counts the number of Multicast frames that has been timed out.') sw_fc_port_tx_mcasts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 30), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortTxMcasts.setStatus('current') if mibBuilder.loadTexts: swFCPortTxMcasts.setDescription('This object counts the number of Multicast frames that has been transmitted.') sw_fc_port_lip_ins = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 31), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortLipIns.setStatus('current') if mibBuilder.loadTexts: swFCPortLipIns.setDescription('This object counts the number of Loop Initializations that has been initiated by loop devices attached.') sw_fc_port_lip_outs = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 32), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortLipOuts.setStatus('current') if mibBuilder.loadTexts: swFCPortLipOuts.setDescription('This object counts the number of Loop Initializations that has been initiated by the port.') sw_fc_port_lip_last_alpa = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 33), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortLipLastAlpa.setStatus('current') if mibBuilder.loadTexts: swFCPortLipLastAlpa.setDescription('This object indicates the Physical Address (AL_PA) of the loop device that initiated the last Loop Initialization.') sw_fc_port_wwn = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 34), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortWwn.setStatus('current') if mibBuilder.loadTexts: swFCPortWwn.setDescription('The World_wide_Name of the Fibre Channel port. The contents of an instance are in the IEEE extended format as specified in FC-PH; the 12-bit port identifier represents the port number within the switch.') sw_fc_port_speed = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 35), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('one-GB', 1), ('two-GB', 2), ('auto-Negotiate', 3), ('four-GB', 4), ('eight-GB', 5), ('ten-GB', 6), ('unknown', 7), ('sixteen-GB', 8)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFCPortSpeed.setStatus('obsolete') if mibBuilder.loadTexts: swFCPortSpeed.setDescription('The desired baud rate for the port. It can have the values of 1GB (1), 2GB (2), Auto-Negotiate (3), 4GB (4), 8GB (5), 10GB (6), 16GB (8). Some of the above values may not be supported by all type of switches.') sw_fc_port_name = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 36), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortName.setStatus('current') if mibBuilder.loadTexts: swFCPortName.setDescription('A string indicates the name of the addressed port. The names should be persistent across switch reboots. Port names do not have to be unique within a switch or within a fabric.') sw_fc_port_specifier = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 37), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortSpecifier.setStatus('current') if mibBuilder.loadTexts: swFCPortSpecifier.setDescription("This string indicates the physical port number of the addressed port. The format of the string is: <slot>/port, where 'slot' being present only for bladed systems. ") sw_fc_port_flag = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 38), fc_port_flag()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortFlag.setStatus('current') if mibBuilder.loadTexts: swFCPortFlag.setDescription('A bit map of port status flags which includes the information of port type. Currently this will indicate if the port is virtual or physical.') sw_fc_port_brcd_type = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 39), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('unknown', 1), ('other', 2), ('fl-port', 3), ('f-port', 4), ('e-port', 5), ('g-port', 6), ('ex-port', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFCPortBrcdType.setStatus('current') if mibBuilder.loadTexts: swFCPortBrcdType.setDescription('The Brocade port type.') sw_fc_port_disable_reason = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 6, 2, 1, 40), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230))).clone(namedValues=named_values(('r-recover-fail', 1), ('r-invalid-reason', 2), ('r-forced', 3), ('r-sw-disabled', 4), ('r-bl-disabled', 5), ('r-slot-off', 6), ('r-sw-enabled', 7), ('r-bl-enabled', 8), ('r-slot-on', 9), ('r-persistid', 10), ('r-sw-violation', 11), ('r-prv-dev-violation', 12), ('r-pub-dev-violation', 13), ('r-port-data-fail', 14), ('r-online-incomplete', 15), ('r-online-route-fail', 16), ('r-inconsistent', 17), ('r-set-vcc-fail', 18), ('r-ecp-in-testing', 19), ('r-elp-in-testing', 20), ('r-ecp-retries-exceeded', 21), ('r-invalid-ecp-state', 22), ('r-bad-ecp-rcvd', 23), ('r-send-rtmark-fail', 24), ('r-send-ecp-fail', 25), ('r-save-link-rtt-fail', 26), ('r-em-incnst', 27), ('r-pci-attach-fail', 28), ('r-buf-starv', 29), ('r-elp-fctl-mismatch', 30), ('r-eport-disabled', 31), ('r-trunk-with-vcxlt', 32), ('r-sw-fl-port-not-ready', 33), ('r-link-reinit', 34), ('r-domain-id-change', 35), ('r-auth-rejected', 36), ('r-auth-timeout', 37), ('r-auth-fail-retry', 38), ('r-fcr-conf-mismatch1', 39), ('r-fcr-conf-mismatch2', 40), ('r-fcr-port-ld-mode-mismatch', 41), ('r-fcr-ld-credit-mismatch', 42), ('r-fcr-set-vcc-failed', 43), ('r-fcr-set-rtc-failed', 44), ('r-fcr-elp-ver-inconsis', 45), ('r-fcr-elp-fctl-mismatch', 46), ('r-fcr-pid-mismatch', 47), ('r-fcr-tov-mismatch', 48), ('r-fcr-ld-incompat', 49), ('r-fcr-isolated', 50), ('r-elp-retries-exceeded', 51), ('r-fcr-exports-exceeded', 52), ('r-fcr-license', 53), ('r-fcr-conf-ex', 54), ('r-fcr-ftag-over', 55), ('r-fcr-ftag-conflict', 56), ('r-fcr-fowner-conflict', 57), ('r-fcr-zone-resource', 58), ('r-fcr-port-state-to', 59), ('r-fcr-authn-reject', 60), ('r-fcr-sec-fcs-list', 61), ('r-fcr-sec-failure', 62), ('r-fcr-incompatible-mode', 63), ('r-fcr-sec-scc-list', 64), ('r-fcr-generic', 65), ('r-sw-ex-port-not-ready', 66), ('r-fcr-class-f-incompat', 67), ('r-fcr-class-n-incompat', 68), ('r-fcr-invalid-flow-rcvd', 69), ('r-fcr-state-disabled', 70), ('r-fdd-strict-exist', 71), ('r-last-port-disable-msg', 72), ('r-sw-l-port-not-support', 73), ('r-peer-port-in-di-zone', 74), ('r-zone-incompat', 75), ('r-sw-config-l-port-not-support', 76), ('r-sw-port-mirror-configured', 77), ('r-nportlogin-inprogress', 78), ('r-nonpiv', 79), ('r-nomapping', 80), ('r-unknowntype', 81), ('r-nportoffline', 82), ('r-flogifailed', 83), ('r-nportbusy', 84), ('r-noflogi', 85), ('r-noflogiresp', 86), ('r-flogidupalpa', 87), ('r-loopcfg', 88), ('r-noenclicense', 89), ('r-nofiportmapping', 90), ('r-brcdfabconn', 91), ('r-port-reset', 92), ('r-floginport', 93), ('r-fdd-strict-conflict', 94), ('r-fdd-cfg-conflict', 95), ('r-fdd-cfg-conflict-na-neigh', 96), ('r-fcr-insistent-front-did-mismatch', 97), ('r-fcr-fabric-binding-failure', 98), ('r-fcr-non-standard-domain-offset', 99), ('r-area-in-use', 100), ('r-mstr-diff-pg', 101), ('r-mstr-diff-area', 102), ('r-ta-not-supported', 103), ('r-eport-not-supported', 104), ('r-fport-not-supported', 105), ('r-cfg-not-supported', 106), ('r-port-ll-th-exceeded', 107), ('r-port-synl-th-exceeded', 108), ('r-port-pe-th-exceeded', 109), ('f-port-disable-no-trk-lic', 110), ('r-port-inw-th-exceeded', 111), ('r-port-crc-th-exceeded', 112), ('f-port-tr-disable-speed-not-ok', 113), ('r-port-auto-disable', 114), ('r-fcr-export-in-non-base-sw', 115), ('r-base-switch-supports-no-device', 116), ('r-port-trunk-proto-error', 117), ('r-no-area-avail', 118), ('r-cannot-unbind-existing-area', 119), ('r-cannot-use-10bit-area', 120), ('r-authentication-required', 121), ('r-port-lr-th-exceeded', 122), ('r-fcr-export-lf-conflict', 123), ('r-incompat', 124), ('r-did-overlap', 125), ('r-zone-conflict', 126), ('r-eport-seg', 127), ('r-no-license', 128), ('r-platform-db', 129), ('r-sec-incompat', 130), ('r-sec-violation', 131), ('r-ecp-longdist', 132), ('r-dup-wwn', 133), ('r-eport-isolated', 134), ('r-ad', 135), ('r-esc-did-offset', 136), ('r-esc-etiz', 137), ('r-esc-fid', 138), ('r-safe-zone', 139), ('r-vf', 140), ('r-vf-bs-incompat', 141), ('r-pers-pid-on-lport', 142), ('r-pers-pid-portaddr-collision', 143), ('r-pers-pid-port-on-same-area', 144), ('r-pers-pid-port-addr-bnd', 145), ('r-msfr', 146), ('r-sw-halfbw-lic', 147), ('r-1g-mode-incompat', 148), ('r-10g-mode-incompat', 149), ('r-dual-mode-incompat', 150), ('r-implict-plt-service-block', 151), ('r-port-st-th-exceeded', 152), ('r-port-c3txto-th-exceeded', 153), ('r-eport-not-supported-def-sw', 154), ('r-eport-ll-th-exceeded', 155), ('r-eport-synl-th-exceeded', 156), ('r-eport-pe-th-exceeded', 157), ('r-eport-inw-th-exceeded', 158), ('r-eport-crc-th-exceeded', 159), ('r-eport-lr-th-exceeded', 160), ('r-eport-st-th-exceeded', 161), ('r-eport-c3txto-th-exceeded', 162), ('r-fopport-ll-th-exceeded', 163), ('r-fopport-synl-th-exceeded', 164), ('r-fopport-pe-th-exceeded', 165), ('r-fopport-inw-th-exceeded', 166), ('r-fopport-crc-th-exceeded', 167), ('r-fopport-lr-th-exceeded', 168), ('r-fopport-st-th-exceeded', 169), ('r-fopport-c3txto-th-exceeded', 170), ('r-fcuport-ll-th-exceeded', 171), ('r-fcuport-synl-th-exceeded', 172), ('r-fcuport-pe-th-exceeded', 173), ('r-fcuport-inw-th-exceeded', 174), ('r-fcuport-crc-th-exceeded', 175), ('r-fcuport-lr-th-exceeded', 176), ('r-fcuport-st-th-exceeded', 177), ('r-fcuport-c3txto-th-exceeded', 178), ('r-port-no-area-avail-pers-disable', 179), ('r-eport-locked', 180), ('r-enh-tizone', 181), ('r-sw-port-swap-not-supported', 182), ('r-fport-slow-drain-condition', 183), ('r-esc-vlanid', 184), ('r-port-recov-state', 185), ('r-port-auto-disable-losn', 186), ('r-port-auto-disable-losg', 187), ('r-port-auto-disable-ols', 188), ('r-port-auto-disable-nos', 189), ('r-port-auto-disable-lip', 190), ('r-port-compression', 191), ('r-port-encryption', 192), ('r-port-enccomp-res', 193), ('r-port-decommissioned', 194), ('r-port-dportmode', 195), ('r-port-dport-incompat', 196), ('r-port-enc-comp-mismatch', 197), ('r-non-rcs-rem-dom', 198), ('r-port-fips-comp-mismatch', 199), ('r-port-non-fips-comp-mismatch', 200), ('r-port-enc-auth-disabled', 201), ('r-port-disable-on-zeroize', 202), ('r-cfgspeed-not-supported', 203), ('r-fcr-ex-port-not-allowed', 204), ('r-port-duplicate-pwwn', 205), ('r-fcr-trunk-master-sfid-not-set', 206), ('r-nportistrunkmem', 207), ('r-policynotsupported', 208), ('r-no-icl-license', 209), ('r-no-ten-gig-license', 210), ('r-fdd-strict-scc-conflict', 211), ('r-fdd-strict-dcc-conflict', 212), ('r-fdd-strict-fcs-conflict', 213), ('r-fdd-strict-fabwide-conflict', 214), ('r-fdd-strict-pwd-conflict', 215), ('r-fcr-interop-conf', 216), ('r-port-enc-interop-conflict', 217), ('r-port-comp-interop-conflict', 218), ('r-no-port-open-rsp', 219), ('r-no-eicl-license', 220), ('r-eicl-license-limited', 221), ('r-esc-base-sw', 222), ('r-sw-cpu-overload', 223), ('r-no-icl-pod2-license', 224), ('r-port-area-mismatch-pers-disable', 225), ('r-unauthorized-device', 226), ('r-max-flogi-reached', 227), ('r-auth-not-supported-in-switch', 228), ('r-icl-ex-on-non-vf', 229), ('r-user-disabled-reason', 230)))) if mibBuilder.loadTexts: swFCPortDisableReason.setStatus('current') if mibBuilder.loadTexts: swFCPortDisableReason.setDescription('It indicates the state change reason when port goes from online to offline') sw_ns_local_num_entry = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsLocalNumEntry.setStatus('current') if mibBuilder.loadTexts: swNsLocalNumEntry.setDescription('The number of local Name Server entries.') sw_ns_local_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2)) if mibBuilder.loadTexts: swNsLocalTable.setStatus('current') if mibBuilder.loadTexts: swNsLocalTable.setDescription('The table of local Name Server entries.') sw_ns_local_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1)).setIndexNames((0, 'SW-MIB', 'swNsEntryIndex')) if mibBuilder.loadTexts: swNsLocalEntry.setStatus('current') if mibBuilder.loadTexts: swNsLocalEntry.setDescription('An entry of the local Name Server database.') sw_ns_entry_index = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsEntryIndex.setStatus('current') if mibBuilder.loadTexts: swNsEntryIndex.setDescription('The object identifies the Name Server database entry.') sw_ns_port_id = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsPortID.setStatus('current') if mibBuilder.loadTexts: swNsPortID.setDescription('The object identifies the Fibre Channel port address ID of the entry.') sw_ns_port_type = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('nPort', 1), ('nlPort', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsPortType.setStatus('current') if mibBuilder.loadTexts: swNsPortType.setDescription('The object identifies the type of port: N_Port, NL_Port, etc., for this entry. The type is defined in FC-GS-2.') sw_ns_port_name = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 4), fc_wwn()).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsPortName.setStatus('current') if mibBuilder.loadTexts: swNsPortName.setDescription('The object identifies the Fibre Channel World_wide Name of the port entry.') sw_ns_port_symb = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 5), octet_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsPortSymb.setStatus('current') if mibBuilder.loadTexts: swNsPortSymb.setDescription("The object identifies the contents of a Symbolic Name of the port entry. In FC-GS-2, a Symbolic Name consists of a byte array of 1 through 255 bytes, and the first byte of the array specifies the length of its 'contents'. This object variable corresponds to the 'contents' of the Symbolic Name, without the first byte.") sw_ns_node_name = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 6), fc_wwn()).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsNodeName.setStatus('current') if mibBuilder.loadTexts: swNsNodeName.setDescription('The object identifies the Fibre Channel World_wide Name of the associated node as defined in FC-GS-2.') sw_ns_node_symb = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsNodeSymb.setStatus('current') if mibBuilder.loadTexts: swNsNodeSymb.setDescription("The object identifies the contents of a Symbolic Name of the the node associated with the entry. In FC-GS-2, a Symbolic Name consists of a byte array of 1 through 255 bytes, and the first byte of the array specifies the length of its 'contents'. This object variable corresponds to the 'contents' of the Symbolic Name, without the first byte (specifying the length).") sw_ns_ipa = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsIPA.setStatus('current') if mibBuilder.loadTexts: swNsIPA.setDescription('The object identifies the Initial Process Associator of the node for the entry as defined in FC-GS-2.') sw_ns_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 9), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsIpAddress.setStatus('current') if mibBuilder.loadTexts: swNsIpAddress.setDescription('The object identifies the IP address of the node for the entry as defined in FC-GS-2. The format of the address is in IPv6.') sw_ns_cos = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15))).clone(namedValues=named_values(('class-F', 1), ('class-1', 2), ('class-F-1', 3), ('class-2', 4), ('class-F-2', 5), ('class-1-2', 6), ('class-F-1-2', 7), ('class-3', 8), ('class-F-3', 9), ('class-1-3', 10), ('class-F-1-3', 11), ('class-2-3', 12), ('class-F-2-3', 13), ('class-1-2-3', 14), ('class-F-1-2-3', 15)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsCos.setStatus('current') if mibBuilder.loadTexts: swNsCos.setDescription('The object identifies the class of services supported by the port. The value is a bit-map defined as follows: o bit 0 is class F, o bit 1 is class 1, o bit 2 is class 2, o bit 3 is class 3, o bit 4 is class 4, etc.') sw_ns_fc4 = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 11), octet_string().subtype(subtypeSpec=value_size_constraint(32, 32)).setFixedLength(32)).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsFc4.setStatus('current') if mibBuilder.loadTexts: swNsFc4.setDescription('The object identifies the FC-4s supported by the port as defined in FC-GS-2.') sw_ns_ip_nx_port = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 12), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsIpNxPort.setStatus('current') if mibBuilder.loadTexts: swNsIpNxPort.setDescription('The object identifies IpAddress of the Nx_port for the entry.') sw_ns_wwn = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 13), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsWwn.setStatus('current') if mibBuilder.loadTexts: swNsWwn.setDescription('The object identifies the World Wide Name (WWN) of the Fx_port for the entry.') sw_ns_hard_addr = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 7, 2, 1, 14), octet_string().subtype(subtypeSpec=value_size_constraint(3, 3)).setFixedLength(3)).setMaxAccess('readonly') if mibBuilder.loadTexts: swNsHardAddr.setStatus('current') if mibBuilder.loadTexts: swNsHardAddr.setDescription('The object identifies the 24-bit hard address of the node for the entry.') sw_event_trap_level = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('none', 0), ('critical', 1), ('error', 2), ('warning', 3), ('informational', 4), ('debug', 5)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swEventTrapLevel.setStatus('deprecated') if mibBuilder.loadTexts: swEventTrapLevel.setDescription("swAgtTrapSeverityLevel, in absence of swEventTrapLevel, specifies the Trap Severity Level of each defined trap recipient host. This object specifies the swEventTrap level in conjunction with an event's severity level. When an event occurs and if its severity level is at or below the value specified by this object instance, the agent will send the associated swEventTrap to configured recipients.") sw_event_num_entries = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swEventNumEntries.setStatus('current') if mibBuilder.loadTexts: swEventNumEntries.setDescription('The number of entries in the Event Table.') sw_event_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5)) if mibBuilder.loadTexts: swEventTable.setStatus('current') if mibBuilder.loadTexts: swEventTable.setDescription('The table of event entries.') sw_event_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1)).setIndexNames((0, 'SW-MIB', 'swEventIndex')) if mibBuilder.loadTexts: swEventEntry.setStatus('current') if mibBuilder.loadTexts: swEventEntry.setDescription('An entry of the event table.') sw_event_index = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swEventIndex.setStatus('current') if mibBuilder.loadTexts: swEventIndex.setDescription('This object identifies the event entry.') sw_event_time_info = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: swEventTimeInfo.setStatus('current') if mibBuilder.loadTexts: swEventTimeInfo.setDescription('This object identifies the date and time when this event occurred, in textual format.') sw_event_level = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('critical', 1), ('error', 2), ('warning', 3), ('informational', 4), ('debug', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swEventLevel.setStatus('current') if mibBuilder.loadTexts: swEventLevel.setDescription('This object identifies the severity level of this event entry.') sw_event_repeat_count = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swEventRepeatCount.setStatus('current') if mibBuilder.loadTexts: swEventRepeatCount.setDescription('This object identifies how many times this particular event has occurred.') sw_event_descr = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: swEventDescr.setStatus('current') if mibBuilder.loadTexts: swEventDescr.setDescription('This object identifies the textual description of the event.') sw_event_vf_id = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 8, 5, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swEventVfId.setStatus('current') if mibBuilder.loadTexts: swEventVfId.setDescription('This object identifies the Virtual fabric id.') class Swfwacts(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63)) named_values = named_values(('swFwNoAction', 0), ('swFwErrlog', 1), ('swFwSnmptrap', 2), ('swFwErrlogSnmptrap', 3), ('swFwPortloglock', 4), ('swFwErrlogPortloglock', 5), ('swFwSnmptrapPortloglock', 6), ('swFwErrlogSnmptrapPortloglock', 7), ('swFwRn', 8), ('swFwElRn', 9), ('swFwStRn', 10), ('swFwElStRn', 11), ('swFwPlRn', 12), ('swFwElPlRn', 13), ('swFwStPlRn', 14), ('swFwElStPlRn', 15), ('swFwMailAlert', 16), ('swFwMailAlertErrlog', 17), ('swFwMailAlertSnmptrap', 18), ('swFwMailAlertErrlogSnmptrap', 19), ('swFwMailAlertPortloglock', 20), ('swFwMailAlertErrlogPortloglock', 21), ('swFwMailAlertSnmptrapPortloglock', 22), ('swFwMailAlertErrlogSnmptrapPortloglock', 23), ('swFwMailAlertRn', 24), ('swFwElMailAlertRn', 25), ('swFwMailAlertStRn', 26), ('swFwMailAlertElStRn', 27), ('swFwMailAlertPlRn', 28), ('swFwMailAlertElPlRn', 29), ('swFwMailAlertStPlRn', 30), ('swFwMailAlertElStPlRn', 31), ('swFwPf', 32), ('swFwElPf', 33), ('swFwStPf', 34), ('swFwElStPf', 35), ('swFwPlPf', 36), ('swFwElPlPf', 37), ('swFwStPlPf', 38), ('swFwElStPlPf', 39), ('swFwRnPf', 40), ('swFwElRnPf', 41), ('swFwStRnPf', 42), ('swFwElStRnPf', 43), ('swFwPlRnPf', 44), ('swFwElPlRnPf', 45), ('swFwStPlRnPf', 46), ('swFwElStPlRnPf', 47), ('swFwMailAlertPf', 48), ('swFwMailAlertElPf', 49), ('swFwMailAlertStPf', 50), ('swFwMailAlertElStPf', 51), ('swFwMailAlertPlPf', 52), ('swFwMailAlertElPlPf', 53), ('swFwMailAlertStPlPf', 54), ('swFwMailAlertElStPlPf', 55), ('swFwMailAlertRnPf', 56), ('swFwMailAlertElRnPf', 57), ('swFwMailAlertStRnPf', 58), ('swFwMailAlertElStRnPf', 59), ('swFwMailAlertPlRnPf', 60), ('swFwMailAlertElPlRnPf', 61), ('swFwMailAlertStPlRnPf', 62), ('swFwMailAlertElStPlRnPf', 63)) class Swfwlevels(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('swFwReserved', 1), ('swFwDefault', 2), ('swFwCustom', 3)) class Swfwclassesareas(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152)) named_values = named_values(('swFwEnvTemp', 1), ('swFwEnvFan', 2), ('swFwEnvPs', 3), ('swFwTransceiverTemp', 4), ('swFwTransceiverRxp', 5), ('swFwTransceiverTxp', 6), ('swFwTransceiverCurrent', 7), ('swFwPortLink', 8), ('swFwPortSync', 9), ('swFwPortSignal', 10), ('swFwPortPe', 11), ('swFwPortWords', 12), ('swFwPortCrcs', 13), ('swFwPortRXPerf', 14), ('swFwPortTXPerf', 15), ('swFwPortState', 16), ('swFwFabricEd', 17), ('swFwFabricFr', 18), ('swFwFabricDi', 19), ('swFwFabricSc', 20), ('swFwFabricZc', 21), ('swFwFabricFq', 22), ('swFwFabricFl', 23), ('swFwFabricGs', 24), ('swFwEPortLink', 25), ('swFwEPortSync', 26), ('swFwEPortSignal', 27), ('swFwEPortPe', 28), ('swFwEPortWords', 29), ('swFwEPortCrcs', 30), ('swFwEPortRXPerf', 31), ('swFwEPortTXPerf', 32), ('swFwEPortState', 33), ('swFwFCUPortLink', 34), ('swFwFCUPortSync', 35), ('swFwFCUPortSignal', 36), ('swFwFCUPortPe', 37), ('swFwFCUPortWords', 38), ('swFwFCUPortCrcs', 39), ('swFwFCUPortRXPerf', 40), ('swFwFCUPortTXPerf', 41), ('swFwFCUPortState', 42), ('swFwFOPPortLink', 43), ('swFwFOPPortSync', 44), ('swFwFOPPortSignal', 45), ('swFwFOPPortPe', 46), ('swFwFOPPortWords', 47), ('swFwFOPPortCrcs', 48), ('swFwFOPPortRXPerf', 49), ('swFwFOPPortTXPerf', 50), ('swFwFOPPortState', 51), ('swFwPerfALPACRC', 52), ('swFwPerfEToECRC', 53), ('swFwPerfEToERxCnt', 54), ('swFwPerfEToETxCnt', 55), ('swFwPerffltCusDef', 56), ('swFwTransceiverVoltage', 57), ('swFwSecTelnetViolations', 58), ('swFwSecHTTPViolations', 59), ('swFwSecAPIViolations', 60), ('swFwSecRSNMPViolations', 61), ('swFwSecWSNMPViolations', 62), ('swFwSecSESViolations', 63), ('swFwSecMSViolations', 64), ('swFwSecSerialViolations', 65), ('swFwSecFPViolations', 66), ('swFwSecSCCViolations', 67), ('swFwSecDCCViolations', 68), ('swFwSecLoginViolations', 69), ('swFwSecInvalidTS', 70), ('swFwSecInvalidSign', 71), ('swFwSecInvalidCert', 72), ('swFwSecSlapFail', 73), ('swFwSecSlapBadPkt', 74), ('swFwSecTSOutSync', 75), ('swFwSecNoFcs', 76), ('swFwSecIncompDB', 77), ('swFwSecIllegalCmd', 78), ('swFwSAMTotalDownTime', 79), ('swFwSAMTotalUpTime', 80), ('swFwSAMDurationOfOccur', 81), ('swFwSAMFreqOfOccur', 82), ('swFwResourceFlash', 83), ('swFwEPortUtil', 84), ('swFwEPortPktl', 85), ('swFwPortLr', 86), ('swFwEPortLr', 87), ('swFwFCUPortLr', 88), ('swFwFOPPortLr', 89), ('swFwPortC3Discard', 90), ('swFwEPortC3Discard', 91), ('swFwFCUPortC3Discard', 92), ('swFwFOPPortC3Discard', 93), ('swFwVEPortStateChange', 94), ('swFwVEPortUtil', 95), ('swFwVEPortPktLoss', 96), ('swFwEPortTrunkUtil', 97), ('swFwFCUPortTrunkUtil', 98), ('swFwFOPPortTrunkUtil', 99), ('swFwCPUMemUsage', 100), ('filterFmCfg1', 101), ('filterFmCfg2', 102), ('filterFmCfg3', 103), ('filterFmCfg4', 104), ('filterFmCfg5', 105), ('filterFmCfg6', 106), ('filterFmCfg7', 107), ('filterFmCfg8', 108), ('filterFmCfg9', 109), ('filterFmCfg10', 110), ('filterFmCfg11', 111), ('filterFmCfg12', 112), ('filterFmCfg13', 113), ('filterFmCfg14', 114), ('filterFmCfg15', 115), ('filterFmCfg16', 116), ('filterFmCfg17', 117), ('filterFmCfg18', 118), ('filterFmCfg19', 119), ('filterFmCfg20', 120), ('filterFmCfg21', 121), ('filterFmCfg22', 122), ('filterFmCfg23', 123), ('filterFmCfg24', 124), ('filterFmCfg25', 125), ('filterFmCfg26', 126), ('filterFmCfg27', 127), ('filterFmCfg28', 128), ('filterFmCfg29', 129), ('filterFmCfg30', 130), ('filterFmCfg31', 131), ('filterFmCfg32', 132), ('filterFmCfg33', 133), ('filterFmCfg34', 134), ('filterFmCfg35', 135), ('filterFmCfg36', 136), ('filterFmCfg37', 137), ('filterFmCfg38', 138), ('filterFmCfg39', 139), ('filterFmCfg40', 140), ('filterFmCfg41', 141), ('filterFmCfg42', 142), ('filterFmCfg43', 143), ('filterFmCfg44', 144), ('filterFmCfg45', 145), ('filterFmCfg46', 146), ('filterFmCfg47', 147), ('filterFmCfg48', 148), ('filterFmCfg49', 149), ('filterFmCfg50', 150), ('filterFmCfg51', 151), ('swFwPowerOnHours', 152)) class Swfwwritevals(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('swFwCancelWrite', 1), ('swFwApplyWrite', 2)) class Swfwtimebase(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5)) named_values = named_values(('swFwTbNone', 1), ('swFwTbSec', 2), ('swFwTbMin', 3), ('swFwTbHour', 4), ('swFwTbDay', 5)) class Swfwstatus(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('disabled', 1), ('enabled', 2)) class Swfwevent(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7)) named_values = named_values(('started', 1), ('changed', 2), ('exceeded', 3), ('below', 4), ('above', 5), ('inBetween', 6), ('lowBufferCrsd', 7)) class Swfwbehavior(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('triggered', 1), ('continuous', 2)) class Swfwstate(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('swFwInformative', 1), ('swFwNormal', 2), ('swFwFaulty', 3)) class Swfwlicense(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('swFwLicensed', 1), ('swFwNotLicensed', 2)) sw_fw_fabric_watch_license = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 1), sw_fw_license()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwFabricWatchLicense.setStatus('current') if mibBuilder.loadTexts: swFwFabricWatchLicense.setDescription('tells if licensed or not.') sw_fw_class_area_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2)) if mibBuilder.loadTexts: swFwClassAreaTable.setStatus('current') if mibBuilder.loadTexts: swFwClassAreaTable.setDescription('The table of classes and areas.') sw_fw_class_area_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1)).setIndexNames((0, 'SW-MIB', 'swFwClassAreaIndex')) if mibBuilder.loadTexts: swFwClassAreaEntry.setStatus('current') if mibBuilder.loadTexts: swFwClassAreaEntry.setDescription('An entry of the classes and areas.') sw_fw_class_area_index = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 1), sw_fw_classes_areas()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwClassAreaIndex.setStatus('current') if mibBuilder.loadTexts: swFwClassAreaIndex.setDescription('This object identifies the class type.') sw_fw_write_th_vals = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 2), sw_fw_write_vals()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwWriteThVals.setStatus('current') if mibBuilder.loadTexts: swFwWriteThVals.setDescription('This object is set to apply the value changes.') sw_fw_default_unit = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwDefaultUnit.setStatus('current') if mibBuilder.loadTexts: swFwDefaultUnit.setDescription('A Default unit string name for a threshold area.') sw_fw_default_timebase = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 4), sw_fw_timebase()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwDefaultTimebase.setStatus('current') if mibBuilder.loadTexts: swFwDefaultTimebase.setDescription('A Default timebase for the current threshold counter.') sw_fw_default_low = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwDefaultLow.setStatus('current') if mibBuilder.loadTexts: swFwDefaultLow.setDescription('A Default low threshold value.') sw_fw_default_high = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwDefaultHigh.setStatus('current') if mibBuilder.loadTexts: swFwDefaultHigh.setDescription('A Default high threshold value.') sw_fw_default_buf_size = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwDefaultBufSize.setStatus('current') if mibBuilder.loadTexts: swFwDefaultBufSize.setDescription('A Default buffer size value.') sw_fw_cust_unit = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwCustUnit.setStatus('current') if mibBuilder.loadTexts: swFwCustUnit.setDescription('A custom unit string name for a threshold area.') sw_fw_cust_timebase = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 9), sw_fw_timebase()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwCustTimebase.setStatus('current') if mibBuilder.loadTexts: swFwCustTimebase.setDescription('A custom timebase for the current threshold counter.') sw_fw_cust_low = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwCustLow.setStatus('current') if mibBuilder.loadTexts: swFwCustLow.setDescription('A custom low threshold value.') sw_fw_cust_high = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwCustHigh.setStatus('current') if mibBuilder.loadTexts: swFwCustHigh.setDescription('A custom high threshold value.') sw_fw_cust_buf_size = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwCustBufSize.setStatus('current') if mibBuilder.loadTexts: swFwCustBufSize.setDescription('A custom buffer size value.') sw_fw_th_level = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 13), sw_fw_levels()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwThLevel.setStatus('current') if mibBuilder.loadTexts: swFwThLevel.setDescription('A level where all the threshold values are set at.') sw_fw_write_act_vals = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 14), sw_fw_write_vals()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwWriteActVals.setStatus('current') if mibBuilder.loadTexts: swFwWriteActVals.setDescription('This object is set to apply act value changes.') sw_fw_default_changed_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 15), sw_fw_acts()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwDefaultChangedActs.setStatus('current') if mibBuilder.loadTexts: swFwDefaultChangedActs.setDescription('Default action matrix for changed event.') sw_fw_default_exceeded_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 16), sw_fw_acts()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwDefaultExceededActs.setStatus('current') if mibBuilder.loadTexts: swFwDefaultExceededActs.setDescription('Default action matrix for exceeded event.') sw_fw_default_below_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 17), sw_fw_acts()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwDefaultBelowActs.setStatus('current') if mibBuilder.loadTexts: swFwDefaultBelowActs.setDescription('Default action matrix for below event.') sw_fw_default_above_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 18), sw_fw_acts()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwDefaultAboveActs.setStatus('current') if mibBuilder.loadTexts: swFwDefaultAboveActs.setDescription('Default action matrix for above event.') sw_fw_default_in_between_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 19), sw_fw_acts()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwDefaultInBetweenActs.setStatus('current') if mibBuilder.loadTexts: swFwDefaultInBetweenActs.setDescription('Default action matrix for in-between event.') sw_fw_cust_changed_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 20), sw_fw_acts()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwCustChangedActs.setStatus('current') if mibBuilder.loadTexts: swFwCustChangedActs.setDescription('custom action matrix for changed event.') sw_fw_cust_exceeded_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 21), sw_fw_acts()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwCustExceededActs.setStatus('current') if mibBuilder.loadTexts: swFwCustExceededActs.setDescription('custom action matrix for exceeded event.') sw_fw_cust_below_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 22), sw_fw_acts()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwCustBelowActs.setStatus('current') if mibBuilder.loadTexts: swFwCustBelowActs.setDescription('custom action matrix for below event.') sw_fw_cust_above_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 23), sw_fw_acts()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwCustAboveActs.setStatus('current') if mibBuilder.loadTexts: swFwCustAboveActs.setDescription('custom action matrix for above event.') sw_fw_cust_in_between_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 24), sw_fw_acts()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwCustInBetweenActs.setStatus('current') if mibBuilder.loadTexts: swFwCustInBetweenActs.setDescription('custom action matrix for in-between event.') sw_fw_valid_acts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 25), sw_fw_acts()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwValidActs.setStatus('current') if mibBuilder.loadTexts: swFwValidActs.setDescription('matrix of valid acts for an class/area.') sw_fw_act_level = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 2, 1, 26), sw_fw_levels()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwActLevel.setStatus('current') if mibBuilder.loadTexts: swFwActLevel.setDescription('A level where all the actions are set at.') sw_fw_threshold_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3)) if mibBuilder.loadTexts: swFwThresholdTable.setStatus('current') if mibBuilder.loadTexts: swFwThresholdTable.setDescription('The table of individual thresholds.') sw_fw_threshold_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1)).setIndexNames((0, 'SW-MIB', 'swFwClassAreaIndex'), (0, 'SW-MIB', 'swFwThresholdIndex')) if mibBuilder.loadTexts: swFwThresholdEntry.setStatus('current') if mibBuilder.loadTexts: swFwThresholdEntry.setDescription('An entry of an individual threshold.') sw_fw_threshold_index = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwThresholdIndex.setStatus('current') if mibBuilder.loadTexts: swFwThresholdIndex.setDescription('This object identifies the element index of an threshold.') sw_fw_status = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 2), sw_fw_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwStatus.setStatus('current') if mibBuilder.loadTexts: swFwStatus.setDescription('This object identifies if an threshold is enabled or disabled.') sw_fw_name = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwName.setStatus('current') if mibBuilder.loadTexts: swFwName.setDescription('This object is a name of the threshold.') sw_fw_label = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 70))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwLabel.setStatus('current') if mibBuilder.loadTexts: swFwLabel.setDescription('This object is a label of the threshold.') sw_fw_cur_val = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwCurVal.setStatus('current') if mibBuilder.loadTexts: swFwCurVal.setDescription('This object is a current counter of the threshold.') sw_fw_last_event = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 6), sw_fw_event()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwLastEvent.setStatus('current') if mibBuilder.loadTexts: swFwLastEvent.setDescription('This object is a last event type of the threshold.') sw_fw_last_event_val = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwLastEventVal.setStatus('current') if mibBuilder.loadTexts: swFwLastEventVal.setDescription('This object is a last event value of the threshold.') sw_fw_last_event_time = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 8), display_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwLastEventTime.setStatus('current') if mibBuilder.loadTexts: swFwLastEventTime.setDescription('This object is a last event time of the threshold.') sw_fw_last_state = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 9), sw_fw_state()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwLastState.setStatus('current') if mibBuilder.loadTexts: swFwLastState.setDescription('This object is a last event state of the threshold.') sw_fw_behavior_type = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 10), sw_fw_behavior()).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwBehaviorType.setStatus('current') if mibBuilder.loadTexts: swFwBehaviorType.setDescription('A behavior of which the thresholds generate event.') sw_fw_behavior_int = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: swFwBehaviorInt.setStatus('current') if mibBuilder.loadTexts: swFwBehaviorInt.setDescription('A integer of which the thresholds generate continuous event.') sw_fw_last_severity_level = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 10, 3, 1, 12), sw_sev_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: swFwLastSeverityLevel.setStatus('current') if mibBuilder.loadTexts: swFwLastSeverityLevel.setDescription('This object is a last event severity level of the threshold.') sw_end_device_rls_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1)) if mibBuilder.loadTexts: swEndDeviceRlsTable.setStatus('current') if mibBuilder.loadTexts: swEndDeviceRlsTable.setDescription("The table of individual end devices' rls.") sw_end_device_rls_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1)).setIndexNames((0, 'SW-MIB', 'swEndDevicePort'), (0, 'SW-MIB', 'swEndDeviceAlpa')) if mibBuilder.loadTexts: swEndDeviceRlsEntry.setStatus('current') if mibBuilder.loadTexts: swEndDeviceRlsEntry.setDescription("An entry of an individual end devices' rls.") sw_end_device_port = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))) if mibBuilder.loadTexts: swEndDevicePort.setStatus('current') if mibBuilder.loadTexts: swEndDevicePort.setDescription('This object identifies the port of the end device.') sw_end_device_alpa = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))) if mibBuilder.loadTexts: swEndDeviceAlpa.setStatus('current') if mibBuilder.loadTexts: swEndDeviceAlpa.setDescription('This object identifies the alpa of the end device.') sw_end_device_port_id = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly') if mibBuilder.loadTexts: swEndDevicePortID.setStatus('current') if mibBuilder.loadTexts: swEndDevicePortID.setDescription('The object identifies the Fibre Channel port address ID of the entry.') sw_end_device_link_failure = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swEndDeviceLinkFailure.setStatus('current') if mibBuilder.loadTexts: swEndDeviceLinkFailure.setDescription('Link failure count for the end device.') sw_end_device_sync_loss = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swEndDeviceSyncLoss.setStatus('current') if mibBuilder.loadTexts: swEndDeviceSyncLoss.setDescription('Sync loss count for the end device.') sw_end_device_sig_loss = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swEndDeviceSigLoss.setStatus('current') if mibBuilder.loadTexts: swEndDeviceSigLoss.setDescription('Sig loss count for the end device.') sw_end_device_proto_err = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swEndDeviceProtoErr.setStatus('current') if mibBuilder.loadTexts: swEndDeviceProtoErr.setDescription('Protocol err count for the end device.') sw_end_device_invalid_word = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swEndDeviceInvalidWord.setStatus('current') if mibBuilder.loadTexts: swEndDeviceInvalidWord.setDescription('Invalid word count for the end device.') sw_end_device_invalid_crc = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 21, 1, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swEndDeviceInvalidCRC.setStatus('current') if mibBuilder.loadTexts: swEndDeviceInvalidCRC.setDescription('Invalid CRC count for the end device.') sw_group_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 1)) if mibBuilder.loadTexts: swGroupTable.setStatus('obsolete') if mibBuilder.loadTexts: swGroupTable.setDescription('The table of groups. This may not be available on all versions of Fabric OS.') sw_group_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 1, 1)).setIndexNames((0, 'SW-MIB', 'swGroupIndex')) if mibBuilder.loadTexts: swGroupEntry.setStatus('obsolete') if mibBuilder.loadTexts: swGroupEntry.setDescription('An entry of table of groups.') sw_group_index = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swGroupIndex.setStatus('obsolete') if mibBuilder.loadTexts: swGroupIndex.setDescription('This object is the group index starting from 1.') sw_group_name = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 1, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: swGroupName.setStatus('obsolete') if mibBuilder.loadTexts: swGroupName.setDescription('This object identifies the name of the group.') sw_group_type = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 1, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 15))).setMaxAccess('readonly') if mibBuilder.loadTexts: swGroupType.setStatus('obsolete') if mibBuilder.loadTexts: swGroupType.setDescription('This object identifies the type of the group.') sw_group_mem_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 2)) if mibBuilder.loadTexts: swGroupMemTable.setStatus('obsolete') if mibBuilder.loadTexts: swGroupMemTable.setDescription('The table of members of all groups. This may not be available on all versions of Fabric OS.') sw_group_mem_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 2, 1)).setIndexNames((0, 'SW-MIB', 'swGroupId'), (0, 'SW-MIB', 'swGroupMemWwn')) if mibBuilder.loadTexts: swGroupMemEntry.setStatus('obsolete') if mibBuilder.loadTexts: swGroupMemEntry.setDescription('An entry for a member of a group.') sw_group_id = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swGroupId.setStatus('obsolete') if mibBuilder.loadTexts: swGroupId.setDescription('This object identifies the Group Id of the member switch.') sw_group_mem_wwn = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 2, 1, 2), fc_wwn()).setMaxAccess('readonly') if mibBuilder.loadTexts: swGroupMemWwn.setStatus('obsolete') if mibBuilder.loadTexts: swGroupMemWwn.setDescription('This object identifies the WWN of the member switch.') sw_group_mem_pos = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 22, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swGroupMemPos.setStatus('obsolete') if mibBuilder.loadTexts: swGroupMemPos.setDescription('This object identifies position of the member switch in the group. This is based on the order that the switches were added in the group.') sw_blm_perf_alpa_mnt_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1)) if mibBuilder.loadTexts: swBlmPerfALPAMntTable.setStatus('current') if mibBuilder.loadTexts: swBlmPerfALPAMntTable.setDescription('ALPA monitoring counter Table. ') sw_blm_perf_alpa_mnt_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1, 1)).setIndexNames((0, 'SW-MIB', 'swBlmPerfAlpaPort'), (0, 'SW-MIB', 'swBlmPerfAlpaIndx')) if mibBuilder.loadTexts: swBlmPerfALPAMntEntry.setStatus('current') if mibBuilder.loadTexts: swBlmPerfALPAMntEntry.setDescription(' ALPA monitoring counter for given ALPA.') sw_blm_perf_alpa_port = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1, 1, 1), sw_port_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfAlpaPort.setStatus('current') if mibBuilder.loadTexts: swBlmPerfAlpaPort.setDescription(' This Object identifies the port index of the switch.') sw_blm_perf_alpa_indx = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 126))).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfAlpaIndx.setStatus('current') if mibBuilder.loadTexts: swBlmPerfAlpaIndx.setDescription(' This Object identifies the ALPA index. There can be 126 ALPA values') sw_blm_perf_alpa = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfAlpa.setStatus('current') if mibBuilder.loadTexts: swBlmPerfAlpa.setDescription(" This Object identifies the ALPA values. These values range between x'01' and x'EF'(1 to 239). ALPA value x'00' is reserved for FL_Port If Alpa device is invalid, then it will have -1 value. ") sw_blm_perf_alpa_crc_cnt = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 1, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfAlpaCRCCnt.setStatus('current') if mibBuilder.loadTexts: swBlmPerfAlpaCRCCnt.setDescription('Get CRC count for given ALPA and port. This monitoring provides information on the number of CRC errors occurred on the frames destined to each possible ALPA attached to a specific port.') sw_blm_perf_ee_mnt_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2)) if mibBuilder.loadTexts: swBlmPerfEEMntTable.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEMntTable.setDescription(' End-to-End monitoring counter Table') sw_blm_perf_ee_mnt_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1)).setIndexNames((0, 'SW-MIB', 'swBlmPerfEEPort'), (0, 'SW-MIB', 'swBlmPerfEERefKey')) if mibBuilder.loadTexts: swBlmPerfEEMntEntry.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEMntEntry.setDescription('End-to-End monitoring counter for given port.') sw_blm_perf_ee_port = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 1), sw_port_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfEEPort.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEPort.setDescription(' This object identifies the port number of the switch.') sw_blm_perf_ee_ref_key = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 8))).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfEERefKey.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEERefKey.setDescription('This object identifies the reference number of the counter. This reference is number assigned when a filter is created. In SNMP Index start one instead of 0, add one to actual ref key') sw_blm_perf_eecrc = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfEECRC.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEECRC.setDescription(' Get End to End CRC error for the frames that matched the SID-DID pair.') sw_blm_perf_eefcw_rx = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfEEFCWRx.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEFCWRx.setDescription('Get End to End count of Fibre Channel words (FCW), received by the port, that matched the SID-DID pair. ') sw_blm_perf_eefcw_tx = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 5), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfEEFCWTx.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEFCWTx.setDescription('Get End to End count of Fibre Channel words (FCW), transmitted by the port, that matched the SID-DID pair. ') sw_blm_perf_ee_sid = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfEESid.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEESid.setDescription(' Gets SID info by reference number. SID (Source Identifier) is a 3-byte field in the frame header used to indicate the address identifier of the N-Port from which the frame was sent.') sw_blm_perf_ee_did = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfEEDid.setStatus('current') if mibBuilder.loadTexts: swBlmPerfEEDid.setDescription('Gets DID info by reference number. DID (Destination Identifier) is a 3-byte field in the frame header used to indicate the address identifier of the N-Port to which the frame was sent.') sw_blm_perf_flt_mnt_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3)) if mibBuilder.loadTexts: swBlmPerfFltMntTable.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltMntTable.setDescription('Filter based monitoring counter.') sw_blm_perf_flt_mnt_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3, 1)).setIndexNames((0, 'SW-MIB', 'swBlmPerfFltPort'), (0, 'SW-MIB', 'swBlmPerfFltRefkey')) if mibBuilder.loadTexts: swBlmPerfFltMntEntry.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltMntEntry.setDescription(' Filter base monitoring counter for given port.') sw_blm_perf_flt_port = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3, 1, 1), sw_port_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfFltPort.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltPort.setDescription('This object identifies the port number of the switch.') sw_blm_perf_flt_refkey = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 8))).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfFltRefkey.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltRefkey.setDescription(' This object identifies the reference number of the filter. This reference number is assigned when a filter is created. In SNMP Index start one instead of 0, add one to actual ref key') sw_blm_perf_flt_cnt = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfFltCnt.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltCnt.setDescription('Get statistics of filter based monitor. Filter based monitoring provides information about a filter hit count such as 1. Read command 2. SCSI or IP traffic 3. SCSI Read/Write') sw_blm_perf_flt_alias = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 23, 3, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 20))).setMaxAccess('readonly') if mibBuilder.loadTexts: swBlmPerfFltAlias.setStatus('current') if mibBuilder.loadTexts: swBlmPerfFltAlias.setDescription(' Alias name for the filter.') sw_switch_trunkable = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(8, 0))).clone(namedValues=named_values(('yes', 8), ('no', 0)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swSwitchTrunkable.setStatus('current') if mibBuilder.loadTexts: swSwitchTrunkable.setDescription('The trunking status of the switch - whether the switch supports the trunking feature or not. The values are yes(8) - the trunking feature is supported no(0). - the trunking feature is not supported. ') sw_trunk_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2)) if mibBuilder.loadTexts: swTrunkTable.setStatus('current') if mibBuilder.loadTexts: swTrunkTable.setDescription(' Table to display trunking information for the switch. ') sw_trunk_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2, 1)).setIndexNames((0, 'SW-MIB', 'swTrunkPortIndex')) if mibBuilder.loadTexts: swTrunkEntry.setStatus('current') if mibBuilder.loadTexts: swTrunkEntry.setDescription('Entry for the trunking table.') sw_trunk_port_index = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2, 1, 1), sw_port_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: swTrunkPortIndex.setStatus('current') if mibBuilder.loadTexts: swTrunkPortIndex.setDescription('This object identifies the switch port index. Note that the value of a port index is 1 higher than the port number labeled on the front panel. e.g. port index 1 correspond to port number 0. ') sw_trunk_group_number = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swTrunkGroupNumber.setStatus('current') if mibBuilder.loadTexts: swTrunkGroupNumber.setDescription('This object is a logical entity which specifies the Group Number to which the port belongs to. If this value is Zero it means the port is not Trunked.') sw_trunk_master = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2, 1, 3), sw_trunk_master()).setMaxAccess('readonly') if mibBuilder.loadTexts: swTrunkMaster.setStatus('current') if mibBuilder.loadTexts: swTrunkMaster.setDescription('Port number that is the trunk master of the group. The trunk master implicitly defines the group. All ports with the same master are considered to be part of the same group.') sw_port_trunked = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swPortTrunked.setStatus('current') if mibBuilder.loadTexts: swPortTrunked.setDescription('The active trunk status for a member port. Values are enabled(1) or disabled(0).') sw_trunk_grp_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3)) if mibBuilder.loadTexts: swTrunkGrpTable.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpTable.setDescription('Table to display trunking Performance information for the switch.') sw_trunk_grp_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3, 1)).setIndexNames((0, 'SW-MIB', 'swTrunkGrpNumber')) if mibBuilder.loadTexts: swTrunkGrpEntry.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpEntry.setDescription('Entry for the trunking Group table.') sw_trunk_grp_number = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: swTrunkGrpNumber.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpNumber.setDescription('This object is a logical entity which specifies the Group Number to which port belongs to.') sw_trunk_grp_master = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3, 1, 2), sw_trunk_master()).setMaxAccess('readonly') if mibBuilder.loadTexts: swTrunkGrpMaster.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpMaster.setDescription('This object gives the master port id for the TrunkGroup.') sw_trunk_grp_tx = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swTrunkGrpTx.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpTx.setDescription('Gives the aggregate value of the transmitted words from this TrunkGroup.') sw_trunk_grp_rx = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 24, 3, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swTrunkGrpRx.setStatus('current') if mibBuilder.loadTexts: swTrunkGrpRx.setDescription('Gives the aggregate value of the received words by this TrunkGroup.') sw_top_talker_mnt_mode = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('fabricmode', 1), ('portmode', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swTopTalkerMntMode.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntMode.setDescription('Gives the mode in which toptalker is installed') sw_top_talker_mnt_num_entries = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: swTopTalkerMntNumEntries.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntNumEntries.setDescription('Gives the number of toptalking flows') sw_top_talker_mnt_table = mib_table((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3)) if mibBuilder.loadTexts: swTopTalkerMntTable.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntTable.setDescription('Table to display toptalkingflows') sw_top_talker_mnt_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1)).setIndexNames((0, 'SW-MIB', 'swTopTalkerMntIndex')) if mibBuilder.loadTexts: swTopTalkerMntEntry.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntEntry.setDescription('Entry for the toptalker table') sw_top_talker_mnt_index = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: swTopTalkerMntIndex.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntIndex.setDescription('This object identifies the list/object entry') sw_top_talker_mnt_port = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: swTopTalkerMntPort.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntPort.setDescription('This object identifies the switch port number on which the f-port mode toptalker is added.') sw_top_talker_mnt_spid = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: swTopTalkerMntSpid.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntSpid.setDescription('This object identifies the SID of the host') sw_top_talker_mnt_dpid = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: swTopTalkerMntDpid.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntDpid.setDescription('This object identifies the DID of the SID-DID pair') sw_top_talker_mntflow = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: swTopTalkerMntflow.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntflow.setDescription('This object identifies the traffic flow in MB/sec') sw_top_talker_mnt_swwn = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 6), fc_wwn()).setMaxAccess('readonly') if mibBuilder.loadTexts: swTopTalkerMntSwwn.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntSwwn.setDescription('This object identifies the SID in WWN format of the host') sw_top_talker_mnt_dwwn = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 25, 3, 1, 7), fc_wwn()).setMaxAccess('readonly') if mibBuilder.loadTexts: swTopTalkerMntDwwn.setStatus('current') if mibBuilder.loadTexts: swTopTalkerMntDwwn.setDescription('This object identifies the DID in WWN format of the SID-DID pair') sw_cpu_usage = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readonly') if mibBuilder.loadTexts: swCpuUsage.setStatus('current') if mibBuilder.loadTexts: swCpuUsage.setDescription("System's cpu usage.") sw_cpu_no_of_retries = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 100))).setMaxAccess('readonly') if mibBuilder.loadTexts: swCpuNoOfRetries.setStatus('current') if mibBuilder.loadTexts: swCpuNoOfRetries.setDescription('Number of times system should take cpu utilization sample before sending the CPU utilization trap.') sw_cpu_usage_limit = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 100))).setMaxAccess('readonly') if mibBuilder.loadTexts: swCpuUsageLimit.setStatus('current') if mibBuilder.loadTexts: swCpuUsageLimit.setDescription('CPU usage limit. If MAPS is enabled, then this object is not supported and return 0 value.') sw_cpu_polling_interval = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 4), integer32().subtype(subtypeSpec=value_range_constraint(10, 3600))).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: swCpuPollingInterval.setStatus('current') if mibBuilder.loadTexts: swCpuPollingInterval.setDescription('Time interval between two memory samples.') sw_cpu_action = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('none', 0), ('raslog', 1), ('snmp', 2), ('raslogandSnmp', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swCpuAction.setStatus('current') if mibBuilder.loadTexts: swCpuAction.setDescription('Specifies the actions to be taken if system resources exceed the specified threshold. If MAPS is enabled, then this object is not supported and return 0 value.') sw_mem_usage = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swMemUsage.setStatus('current') if mibBuilder.loadTexts: swMemUsage.setDescription("System's memory usage.") sw_mem_no_of_retries = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swMemNoOfRetries.setStatus('current') if mibBuilder.loadTexts: swMemNoOfRetries.setDescription('Number of times system should take memory usage sample before sending the memory usage trap.') sw_mem_usage_limit = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swMemUsageLimit.setStatus('current') if mibBuilder.loadTexts: swMemUsageLimit.setDescription('Memory usage limit') sw_mem_polling_interval = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 9), integer32().subtype(subtypeSpec=value_range_constraint(10, 3600))).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: swMemPollingInterval.setStatus('current') if mibBuilder.loadTexts: swMemPollingInterval.setDescription('Time interval between two memory samples.') sw_mem_action = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('none', 0), ('raslog', 1), ('snmp', 2), ('raslogandSnmp', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swMemAction.setStatus('current') if mibBuilder.loadTexts: swMemAction.setDescription('Specifies the actions to be taken if system resources exceed the specified threshold. If MAPS is enabled, then this object is not supported and return 0 value.') sw_mem_usage_limit1 = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 11), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swMemUsageLimit1.setStatus('current') if mibBuilder.loadTexts: swMemUsageLimit1.setDescription('Low memory usage limit. If MAPS is enabled, then this object is not supported and return 0 value.') sw_mem_usage_limit3 = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 26, 12), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: swMemUsageLimit3.setStatus('current') if mibBuilder.loadTexts: swMemUsageLimit3.setDescription('High memory usage limit. If MAPS is enabled, then this object is not supported and return 0 value.') sw_conn_unit_port_stat_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1)) connUnitPortStatEntry.registerAugmentions(('SW-MIB', 'swConnUnitPortStatEntry')) swConnUnitPortStatEntry.setIndexNames(*connUnitPortStatEntry.getIndexNames()) if mibBuilder.loadTexts: swConnUnitPortStatEntry.setStatus('current') if mibBuilder.loadTexts: swConnUnitPortStatEntry.setDescription('This represents the Conn unit Port Stats') sw_conn_unit_crc_with_bad_eof = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitCRCWithBadEOF.setStatus('current') if mibBuilder.loadTexts: swConnUnitCRCWithBadEOF.setDescription('The number of frames with CRC error with Bad EOF.') sw_conn_unit_zero_tenancy = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitZeroTenancy.setStatus('current') if mibBuilder.loadTexts: swConnUnitZeroTenancy.setDescription('This counter is incremented when the FL_port acquires the loop but does not transmit a frame.') sw_conn_unit_fl_num_of_tenancy = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitFLNumOfTenancy.setStatus('current') if mibBuilder.loadTexts: swConnUnitFLNumOfTenancy.setDescription('This counter is incremented when the FL_port acquires the loop.') sw_conn_unit_nl_num_of_tenancy = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitNLNumOfTenancy.setStatus('current') if mibBuilder.loadTexts: swConnUnitNLNumOfTenancy.setDescription('This counter is incremented when the NL_port acquires the loop.') sw_conn_unit_stop_tenancy_star_vation = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 5), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitStopTenancyStarVation.setStatus('current') if mibBuilder.loadTexts: swConnUnitStopTenancyStarVation.setDescription('This counter is incremented when the FL_port can not transmit a frame because of lack of credit.') sw_conn_unit_opend = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 6), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitOpend.setStatus('current') if mibBuilder.loadTexts: swConnUnitOpend.setDescription('The number of times FC port entered OPENED state.') sw_conn_unit_transfer_connection = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitTransferConnection.setStatus('current') if mibBuilder.loadTexts: swConnUnitTransferConnection.setDescription('The number of times FC port entered TRANSFER state.') sw_conn_unit_open = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitOpen.setStatus('current') if mibBuilder.loadTexts: swConnUnitOpen.setDescription('The number of times FC port entered OPEN state.') sw_conn_unit_invalid_arb = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 9), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitInvalidARB.setStatus('current') if mibBuilder.loadTexts: swConnUnitInvalidARB.setDescription('The number of times FC port received invalid ARB.') sw_conn_unit_ftb1_miss = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 10), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitFTB1Miss.setStatus('current') if mibBuilder.loadTexts: swConnUnitFTB1Miss.setDescription('This counter is incremented when the port receives a frame with a DID that can not be routed by FCR.. Applicable to 8G platforms only.') sw_conn_unit_ftb2_miss = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 11), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitFTB2Miss.setStatus('current') if mibBuilder.loadTexts: swConnUnitFTB2Miss.setDescription('This counter is incremented when the port receives a frame with an SID/DID combination that can not be routed by the VF module.Applicable to 8G platforms only.') sw_conn_unit_ftb6_miss = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 12), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitFTB6Miss.setStatus('current') if mibBuilder.loadTexts: swConnUnitFTB6Miss.setDescription('This counter is incremented when port receives a frame with an SID that can not be routed by FCR. Applicable to 8G platforms.') sw_conn_unit_zone_miss = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 13), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitZoneMiss.setStatus('current') if mibBuilder.loadTexts: swConnUnitZoneMiss.setDescription('This counter is incremented when the port receives a frame with an SID and DID that are not zoned together.') sw_conn_unit_lun_zone_miss = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 14), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitLunZoneMiss.setStatus('current') if mibBuilder.loadTexts: swConnUnitLunZoneMiss.setDescription('This counter is incremented when the port receives a frame with an SID, DID and LUN that are not zoned together( This is not currently used ).') sw_conn_unit_bad_eof = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 15), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitBadEOF.setStatus('current') if mibBuilder.loadTexts: swConnUnitBadEOF.setDescription('The number of frames with bad end-of-frame.') sw_conn_unit_lcrx = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 16), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitLCRX.setStatus('current') if mibBuilder.loadTexts: swConnUnitLCRX.setDescription('The number of link control frames received.') sw_conn_unit_rdy_priority = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 17), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitRDYPriority.setStatus('current') if mibBuilder.loadTexts: swConnUnitRDYPriority.setDescription('The number of times that sending R_RDY or VC_RDY primitive signals was a higher priority than sending frames, due to diminishing credit reserves in the transmitter at the other end of the fibre.') sw_conn_unit_lli = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 18), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitLli.setStatus('current') if mibBuilder.loadTexts: swConnUnitLli.setDescription('The number low level interrupts generated by the physical and link layer.') sw_conn_unit_interrupts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 19), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitInterrupts.setStatus('current') if mibBuilder.loadTexts: swConnUnitInterrupts.setDescription(' This represents all the interrupts received on a port. Includes LLI, unknown etc') sw_conn_unit_unknown_interrupts = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 20), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitUnknownInterrupts.setStatus('current') if mibBuilder.loadTexts: swConnUnitUnknownInterrupts.setDescription(' Represents all the unknown interrupts received on a port.') sw_conn_unit_timed_out = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 21), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitTimedOut.setStatus('current') if mibBuilder.loadTexts: swConnUnitTimedOut.setDescription('Represents number of timed out frames due to any reason.') sw_conn_unit_proc_required = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 22), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitProcRequired.setStatus('current') if mibBuilder.loadTexts: swConnUnitProcRequired.setDescription('Represents number of frames trapped by CPU.') sw_conn_unit_tx_buffer_unavailable = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 23), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitTxBufferUnavailable.setStatus('current') if mibBuilder.loadTexts: swConnUnitTxBufferUnavailable.setDescription('Number of times port failed to transmit frames .') sw_conn_unit_state_change = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 24), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitStateChange.setStatus('current') if mibBuilder.loadTexts: swConnUnitStateChange.setDescription(' Number of times port has gone to offline, online, and faulty state.') sw_conn_unit_c3_discard_due_to_rx_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 25), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitC3DiscardDueToRXTimeout.setStatus('current') if mibBuilder.loadTexts: swConnUnitC3DiscardDueToRXTimeout.setDescription('Number of Class 3 receive frames discarded due to timeout.') sw_conn_unit_c3_discard_due_to_dest_unreachable = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 26), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitC3DiscardDueToDestUnreachable.setStatus('current') if mibBuilder.loadTexts: swConnUnitC3DiscardDueToDestUnreachable.setDescription('Number of Class 3 frames discarded due to destination unreachable.') sw_conn_unit_c3_discard_due_to_tx_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 27), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitC3DiscardDueToTXTimeout.setStatus('current') if mibBuilder.loadTexts: swConnUnitC3DiscardDueToTXTimeout.setDescription('Number of Class 3 transmit frames discarded due to timeout.') sw_conn_unit_c3_discard_other = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 28), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitC3DiscardOther.setStatus('current') if mibBuilder.loadTexts: swConnUnitC3DiscardOther.setDescription('Number of Class 3 frames discarded due to unknow reasons.') sw_conn_unit_pcs_error_counter = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 29), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitPCSErrorCounter.setStatus('current') if mibBuilder.loadTexts: swConnUnitPCSErrorCounter.setDescription('Number of Physical coding sublayer(PCS) block errors. It records the encoding violations on 10G or 16Gbps port.') sw_conn_unit_unroutable_frame_counter = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 30), octet_string().subtype(subtypeSpec=value_size_constraint(8, 8)).setFixedLength(8)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitUnroutableFrameCounter.setStatus('current') if mibBuilder.loadTexts: swConnUnitUnroutableFrameCounter.setDescription('It indicates unroutable frame counter') sw_conn_unit_fec_corrected_counter = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 31), octet_string().subtype(subtypeSpec=value_size_constraint(64, 64)).setFixedLength(64)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitFECCorrectedCounter.setStatus('current') if mibBuilder.loadTexts: swConnUnitFECCorrectedCounter.setDescription('It indicates Forward Error Correction Corrected Blocks count.FEC feature is only applicable to 10G/16G platforms.') sw_conn_unit_fec_un_corrected_counter = mib_table_column((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 27, 1, 32), octet_string().subtype(subtypeSpec=value_size_constraint(64, 64)).setFixedLength(64)).setMaxAccess('readonly') if mibBuilder.loadTexts: swConnUnitFECUnCorrectedCounter.setStatus('current') if mibBuilder.loadTexts: swConnUnitFECUnCorrectedCounter.setDescription('It indicates Forward Error Correction UnCorrected Blocks count.FEC feature is only applicable to 10G/16G platforms.') sw_traps_v2 = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0)) if mibBuilder.loadTexts: swTrapsV2.setStatus('current') if mibBuilder.loadTexts: swTrapsV2.setDescription("The Traps for Brocade's Fibre Channel Switch.") sw_fault = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 1)).setObjects(('SW-MIB', 'swDiagResult'), ('SW-MIB', 'swSsn')) if mibBuilder.loadTexts: swFault.setStatus('obsolete') if mibBuilder.loadTexts: swFault.setDescription("Obsoleted this trap as firmware doesn't support this trap. A swFault(1) is generated whenever the diagnostics detects a fault with the switch.") sw_sensor_scn = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 2)).setObjects(('SW-MIB', 'swSensorStatus'), ('SW-MIB', 'swSensorIndex'), ('SW-MIB', 'swSensorType'), ('SW-MIB', 'swSensorValue'), ('SW-MIB', 'swSensorInfo'), ('SW-MIB', 'swSsn')) if mibBuilder.loadTexts: swSensorScn.setStatus('current') if mibBuilder.loadTexts: swSensorScn.setDescription('A swSensorScn(2) is generated whenever an environment sensor changes its operational state. For instance, a fan stop working. The VarBind in the Trap Data Unit shall contain the corresponding instance of the sensor status, sensor index, sensor type, sensor value (reading) and sensor information. Note that the sensor information contains the type of sensor and its number in textual format.') sw_fc_port_scn = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 3)).setObjects(('SW-MIB', 'swFCPortOpStatus'), ('SW-MIB', 'swFCPortIndex'), ('SW-MIB', 'swFCPortName'), ('SW-MIB', 'swFCPortWwn'), ('SW-MIB', 'swFCPortPrevType'), ('SW-MIB', 'swFCPortBrcdType'), ('SW-MIB', 'swSsn'), ('SW-MIB', 'swFCPortFlag'), ('SW-MIB', 'swFCPortDisableReason'), ('SW-MIB', 'swVfId')) if mibBuilder.loadTexts: swFCPortScn.setStatus('current') if mibBuilder.loadTexts: swFCPortScn.setDescription('This trap is sent whenever an FC port operational status or its type changed. The events that trigger this trap are port goes to online/offline, port type changed to E-port/F-port/FL-port. swFCPortName and swSsn are optional varbind in the trap PDU') sw_event_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 4)).setObjects(('SW-MIB', 'swEventIndex'), ('SW-MIB', 'swEventTimeInfo'), ('SW-MIB', 'swEventLevel'), ('SW-MIB', 'swEventRepeatCount'), ('SW-MIB', 'swEventDescr'), ('SW-MIB', 'swSsn'), ('SW-MIB', 'swVfId')) if mibBuilder.loadTexts: swEventTrap.setStatus('current') if mibBuilder.loadTexts: swEventTrap.setDescription('This trap is generated when an event whose level at or below swEventTrapLevel occurs.') sw_fabric_watch_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 5)).setObjects(('SW-MIB', 'swFwClassAreaIndex'), ('SW-MIB', 'swFwThresholdIndex'), ('SW-MIB', 'swFwName'), ('SW-MIB', 'swFwLabel'), ('SW-MIB', 'swFwLastEventVal'), ('SW-MIB', 'swFwLastEventTime'), ('SW-MIB', 'swFwLastEvent'), ('SW-MIB', 'swFwLastState'), ('SW-MIB', 'swFwLastSeverityLevel'), ('SW-MIB', 'swSsn'), ('SW-MIB', 'swVfId')) if mibBuilder.loadTexts: swFabricWatchTrap.setStatus('current') if mibBuilder.loadTexts: swFabricWatchTrap.setDescription('trap to be sent by Fabric Watch to notify of an event.') sw_track_changes_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 6)).setObjects(('SW-MIB', 'swTrackChangesInfo'), ('SW-MIB', 'swSsn'), ('SW-MIB', 'swVfId')) if mibBuilder.loadTexts: swTrackChangesTrap.setStatus('current') if mibBuilder.loadTexts: swTrackChangesTrap.setDescription('trap to be sent for tracking login/logout/config changes.') sw_i_pv6_change_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 7)).setObjects(('SW-MIB', 'swIPv6Address'), ('SW-MIB', 'swIPv6Status')) if mibBuilder.loadTexts: swIPv6ChangeTrap.setStatus('current') if mibBuilder.loadTexts: swIPv6ChangeTrap.setDescription('This trap is generated when an ipv6 address status change event occurs.') sw_pmgr_event_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 8)).setObjects(('SW-MIB', 'swPmgrEventType'), ('SW-MIB', 'swPmgrEventTime'), ('SW-MIB', 'swPmgrEventDescr'), ('SW-MIB', 'swSsn'), ('SW-MIB', 'swVfId')) if mibBuilder.loadTexts: swPmgrEventTrap.setStatus('current') if mibBuilder.loadTexts: swPmgrEventTrap.setDescription('This trap is generated when any partition manager change happens.') sw_fabric_reconfig_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 9)).setObjects(('SW-MIB', 'swDomainID')) if mibBuilder.loadTexts: swFabricReconfigTrap.setStatus('current') if mibBuilder.loadTexts: swFabricReconfigTrap.setDescription('trap to be sent for tracking fabric reconfiguration') sw_fabric_segment_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 10)).setObjects(('SW-MIB', 'swFCPortIndex'), ('SW-MIB', 'swFCPortName'), ('SW-MIB', 'swSsn'), ('SW-MIB', 'swFCPortFlag'), ('SW-MIB', 'swVfId')) if mibBuilder.loadTexts: swFabricSegmentTrap.setStatus('current') if mibBuilder.loadTexts: swFabricSegmentTrap.setDescription('trap to be sent for tracking segmentation') sw_ext_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 11)) if mibBuilder.loadTexts: swExtTrap.setStatus('current') if mibBuilder.loadTexts: swExtTrap.setDescription('THIS IS INTERNAL TRAP') sw_state_change_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 12)).setObjects(('SW-MIB', 'swOperStatus'), ('SW-MIB', 'swVfId')) if mibBuilder.loadTexts: swStateChangeTrap.setStatus('current') if mibBuilder.loadTexts: swStateChangeTrap.setDescription('This trap is sent whenever switch state changes to online/offline') sw_port_move_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 13)).setObjects(('SW-MIB', 'swPortList'), ('SW-MIB', 'swVfId')) if mibBuilder.loadTexts: swPortMoveTrap.setStatus('current') if mibBuilder.loadTexts: swPortMoveTrap.setDescription('This trap is sent when ports are moved from one switch to another') sw_brcd_generic_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 14)).setObjects(('SW-MIB', 'swBrcdTrapBitMask')) if mibBuilder.loadTexts: swBrcdGenericTrap.setStatus('current') if mibBuilder.loadTexts: swBrcdGenericTrap.setDescription("This trap is sent when there is any one of the following event occured. 1. fabric change 2. device change 3. Fapwwn change 4. fdmi event This Trap is strictly for brocade's internal usage.") sw_device_status_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 15)).setObjects(('SW-MIB', 'swFCPortSpecifier'), ('SW-MIB', 'swDeviceStatus'), ('SW-MIB', 'swEndDevicePortID'), ('SW-MIB', 'swNsNodeName')) if mibBuilder.loadTexts: swDeviceStatusTrap.setStatus('current') if mibBuilder.loadTexts: swDeviceStatusTrap.setDescription('This trap is sent whenever there is a device login or logout') sw_zone_config_change_trap = notification_type((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 1, 0, 16)).setObjects(('SW-MIB', 'swVfId')) if mibBuilder.loadTexts: swZoneConfigChangeTrap.setStatus('current') if mibBuilder.loadTexts: swZoneConfigChangeTrap.setDescription('This trap is sent whenever there is change in local zone database.') mibBuilder.exportSymbols('SW-MIB', swFwCustUnit=swFwCustUnit, swIDIDMode=swIDIDMode, swSensorValue=swSensorValue, swFabric=swFabric, swTrunkMaster=swTrunkMaster, swDeviceStatusTrap=swDeviceStatusTrap, swTrunkGrpMaster=swTrunkGrpMaster, swFabricMemName=swFabricMemName, swSensorType=swSensorType, sw20x0=sw20x0, swTrunkPortIndex=swTrunkPortIndex, swGroupTable=swGroupTable, swFwClassAreaEntry=swFwClassAreaEntry, swNsWwn=swNsWwn, swBlmPerfEESid=swBlmPerfEESid, swFCPortAdmStatus=swFCPortAdmStatus, swGroupName=swGroupName, swFwValidActs=swFwValidActs, swTrunkGrpNumber=swTrunkGrpNumber, swEventTable=swEventTable, swConnUnitTxBufferUnavailable=swConnUnitTxBufferUnavailable, swFCPortType=swFCPortType, swTrackChangesInfo=swTrackChangesInfo, swTopTalkerMntNumEntries=swTopTalkerMntNumEntries, swFCPortTooManyRdys=swFCPortTooManyRdys, swTopTalkerMntDwwn=swTopTalkerMntDwwn, swSensorInfo=swSensorInfo, swVfName=swVfName, swEventTrapLevel=swEventTrapLevel, swFwDefaultBelowActs=swFwDefaultBelowActs, swGroupEntry=swGroupEntry, swFabricSegmentTrap=swFabricSegmentTrap, swGroup=swGroup, swEndDevicePortID=swEndDevicePortID, SwFwWriteVals=SwFwWriteVals, swFCPortPhyState=swFCPortPhyState, swTopTalkerMntSwwn=swTopTalkerMntSwwn, swTrunkTable=swTrunkTable, swVfId=swVfId, SwFwClassesAreas=SwFwClassesAreas, swSwitchTrunkable=swSwitchTrunkable, swFwCustHigh=swFwCustHigh, swFwLastEventTime=swFwLastEventTime, swFlashDLPassword=swFlashDLPassword, swBlmPerfAlpa=swBlmPerfAlpa, swFCPortMcastTimedOuts=swFCPortMcastTimedOuts, swConnUnitC3DiscardDueToRXTimeout=swConnUnitC3DiscardDueToRXTimeout, swTopTalkerMntflow=swTopTalkerMntflow, swExtTrap=swExtTrap, swFCPortLipIns=swFCPortLipIns, swBlmPerfEEDid=swBlmPerfEEDid, swNsPortName=swNsPortName, PYSNMP_MODULE_ID=swMibModule, swEventIndex=swEventIndex, swNsPortID=swNsPortID, swCpuUsageLimit=swCpuUsageLimit, swPortMoveTrap=swPortMoveTrap, swFwClassAreaTable=swFwClassAreaTable, swFCPortRxBadEofs=swFCPortRxBadEofs, swBlmPerfMnt=swBlmPerfMnt, swFCPortLipLastAlpa=swFCPortLipLastAlpa, swFwSystem=swFwSystem, swBlmPerfFltMntEntry=swBlmPerfFltMntEntry, swFCPortRxCrcs=swFCPortRxCrcs, swTopTalkerMntPort=swTopTalkerMntPort, swEndDeviceSyncLoss=swEndDeviceSyncLoss, swBlmPerfEEPort=swBlmPerfEEPort, swFlashDLFile=swFlashDLFile, swConnUnitUnknownInterrupts=swConnUnitUnknownInterrupts, swNumSensors=swNumSensors, swFlashDLOperStatus=swFlashDLOperStatus, swTopTalkerMntSpid=swTopTalkerMntSpid, swConnUnitC3DiscardDueToDestUnreachable=swConnUnitC3DiscardDueToDestUnreachable, swFault=swFault, swFCPortTable=swFCPortTable, swBlmPerfAlpaPort=swBlmPerfAlpaPort, swFwDefaultUnit=swFwDefaultUnit, swConnUnitLCRX=swConnUnitLCRX, swFCIPMask=swFCIPMask, swConnUnitRDYPriority=swConnUnitRDYPriority, swFCport=swFCport, swConnUnitTransferConnection=swConnUnitTransferConnection, swNsCos=swNsCos, swEventNumEntries=swEventNumEntries, swBlmPerfEERefKey=swBlmPerfEERefKey, swTopTalkerMntMode=swTopTalkerMntMode, swGroupIndex=swGroupIndex, swConnUnitZeroTenancy=swConnUnitZeroTenancy, swFabricWatchTrap=swFabricWatchTrap, swNsIpAddress=swNsIpAddress, swBlmPerfFltMntTable=swBlmPerfFltMntTable, swMemNoOfRetries=swMemNoOfRetries, swNsPortSymb=swNsPortSymb, swNsIpNxPort=swNsIpNxPort, swIPv6ChangeTrap=swIPv6ChangeTrap, swTrunk=swTrunk, swBlmPerfAlpaIndx=swBlmPerfAlpaIndx, swBlmPerfEEMntTable=swBlmPerfEEMntTable, swConnUnitPortStatEntry=swConnUnitPortStatEntry, swEndDevicePort=swEndDevicePort, swFCPortRxC2Frames=swFCPortRxC2Frames, swDomainID=swDomainID, swAdmStatus=swAdmStatus, swGroupMemWwn=swGroupMemWwn, swMemAction=swMemAction, SwFwState=SwFwState, swNbEntry=swNbEntry, swFabricMemEntry=swFabricMemEntry, swFabricMemDid=swFabricMemDid, FcPortFlag=FcPortFlag, swFwCustLow=swFwCustLow, swFCPortSpeed=swFCPortSpeed, swTelnetShellAdmStatus=swTelnetShellAdmStatus, swFwStatus=swFwStatus, swConnUnitUnroutableFrameCounter=swConnUnitUnroutableFrameCounter, swNsEntryIndex=swNsEntryIndex, swFCPortRxFrames=swFCPortRxFrames, swConnUnitBadEOF=swConnUnitBadEOF, swEndDeviceInvalidWord=swEndDeviceInvalidWord, swSensorEntry=swSensorEntry, swConnUnitPCSErrorCounter=swConnUnitPCSErrorCounter, SwFwLicense=SwFwLicense, swSensorStatus=swSensorStatus, swNs=swNs, swMemUsage=swMemUsage, swAgtCmtyIdx=swAgtCmtyIdx, swFwDefaultLow=swFwDefaultLow, swNbMyPort=swNbMyPort, swFCPortIndex=swFCPortIndex, swSsn=swSsn, swConnUnitInvalidARB=swConnUnitInvalidARB, swConnUnitFTB1Miss=swConnUnitFTB1Miss, swNsHardAddr=swNsHardAddr, swEventEntry=swEventEntry, swModel=swModel, swFCIPAddress=swFCIPAddress, swFCPortTxFrames=swFCPortTxFrames, swEndDevice=swEndDevice, swEventVfId=swEventVfId, swFWLastUpdated=swFWLastUpdated, swConnUnitInterrupts=swConnUnitInterrupts, swFwWriteActVals=swFwWriteActVals, swFlashDLAdmStatus=swFlashDLAdmStatus, swEvent=swEvent, swEtherIPMask=swEtherIPMask, SwFwActs=SwFwActs, swFwThLevel=swFwThLevel, swFwCustBelowActs=swFwCustBelowActs, sw=sw, swCpuPollingInterval=swCpuPollingInterval, swBlmPerfFltCnt=swBlmPerfFltCnt, swFwFabricWatchLicense=swFwFabricWatchLicense, swAgtTrapSeverityLevel=swAgtTrapSeverityLevel, swPortTrunked=swPortTrunked, swEventLevel=swEventLevel, swSensorTable=swSensorTable, swPmgrEventTrap=swPmgrEventTrap, swTrunkEntry=swTrunkEntry, swFwLastSeverityLevel=swFwLastSeverityLevel, swNumNbs=swNumNbs, swGroupMemEntry=swGroupMemEntry, SwFwLevels=SwFwLevels, swBlmPerfAlpaCRCCnt=swBlmPerfAlpaCRCCnt, swFlashLastUpdated=swFlashLastUpdated, swZoneConfigChangeTrap=swZoneConfigChangeTrap, swBootPromLastUpdated=swBootPromLastUpdated, swNsLocalEntry=swNsLocalEntry, swFwLastEvent=swFwLastEvent, swFwClassAreaIndex=swFwClassAreaIndex, swBlmPerfEEFCWRx=swBlmPerfEEFCWRx, swConnUnitOpen=swConnUnitOpen, swBlmPerfEEFCWTx=swBlmPerfEEFCWTx, swFwCustAboveActs=swFwCustAboveActs, swNbTable=swNbTable, swNsPortType=swNsPortType, swConnUnitStopTenancyStarVation=swConnUnitStopTenancyStarVation, swFwThresholdEntry=swFwThresholdEntry, swMibModule=swMibModule, swConnUnitFTB2Miss=swConnUnitFTB2Miss, swAgtCmtyStr=swAgtCmtyStr, swFCPortRxC3Frames=swFCPortRxC3Frames, swID=swID, swDeviceStatus=swDeviceStatus, swBlmPerfALPAMntTable=swBlmPerfALPAMntTable, swFCPortCapacity=swFCPortCapacity, swBrcdTrapBitMask=swBrcdTrapBitMask, swNsNodeName=swNsNodeName, swFwBehaviorInt=swFwBehaviorInt, swFCPortBrcdType=swFCPortBrcdType, swFabricMemTable=swFabricMemTable, swFCPortEntry=swFCPortEntry, swTrunkGroupNumber=swTrunkGroupNumber, swTopTalkerMntDpid=swTopTalkerMntDpid, swprivProtocolPassword=swprivProtocolPassword, swFwWriteThVals=swFwWriteThVals, swConnUnitZoneMiss=swConnUnitZoneMiss, swFCPortRxEncOutFrs=swFCPortRxEncOutFrs, swBootDate=swBootDate, swFCPortLipOuts=swFCPortLipOuts, swGroupMemPos=swGroupMemPos, swTrackChangesTrap=swTrackChangesTrap, swConnUnitNLNumOfTenancy=swConnUnitNLNumOfTenancy, swFCPortRxEncInFrs=swFCPortRxEncInFrs, swBeaconAdmStatus=swBeaconAdmStatus, swBlmPerfEEMntEntry=swBlmPerfEEMntEntry, swEventDescr=swEventDescr, swNbIslCost=swNbIslCost, swConnUnitC3DiscardDueToTXTimeout=swConnUnitC3DiscardDueToTXTimeout, swFwCustExceededActs=swFwCustExceededActs, swEventRepeatCount=swEventRepeatCount, swFCPortTxMcasts=swFCPortTxMcasts, swConnUnitOpend=swConnUnitOpend, swOperStatus=swOperStatus, swBlmPerfALPAMntEntry=swBlmPerfALPAMntEntry, swFwDefaultInBetweenActs=swFwDefaultInBetweenActs, sw21kN24k=sw21kN24k, swFwDefaultExceededActs=swFwDefaultExceededActs, swModule=swModule, swBlmPerfEECRC=swBlmPerfEECRC, swNbRemDomain=swNbRemDomain, swCpuOrMemoryUsage=swCpuOrMemoryUsage, swAgtCmtyEntry=swAgtCmtyEntry, swFCPortRxTooLongs=swFCPortRxTooLongs, swIPv6Address=swIPv6Address, swTopTalkerMntEntry=swTopTalkerMntEntry, swFwLastState=swFwLastState, swMemUsageLimit1=swMemUsageLimit1, swTrunkGrpTable=swTrunkGrpTable, swSystem=swSystem, swFwThresholdIndex=swFwThresholdIndex, swPortList=swPortList, swFCPortNoTxCredits=swFCPortNoTxCredits, swFCPortC3Discards=swFCPortC3Discards, swEndDeviceAlpa=swEndDeviceAlpa, swFirmwareVersion=swFirmwareVersion, swGroupType=swGroupType, swEndDeviceSigLoss=swEndDeviceSigLoss, swTrapsV2=swTrapsV2, swMemUsageLimit=swMemUsageLimit, swConnUnitFECCorrectedCounter=swConnUnitFECCorrectedCounter, swTopTalker=swTopTalker, swFabricReconfigTrap=swFabricReconfigTrap, swConnUnitC3DiscardOther=swConnUnitC3DiscardOther, swFlashDLUser=swFlashDLUser, swauthProtocolPassword=swauthProtocolPassword, swCpuNoOfRetries=swCpuNoOfRetries, SwSevType=SwSevType, swFwName=swFwName, swFwDefaultChangedActs=swFwDefaultChangedActs, swFwCustTimebase=swFwCustTimebase, swTrunkGrpEntry=swTrunkGrpEntry, swAgtTrapRcp=swAgtTrapRcp, swCpuUsage=swCpuUsage, swEndDeviceRlsEntry=swEndDeviceRlsEntry) mibBuilder.exportSymbols('SW-MIB', swFwCustInBetweenActs=swFwCustInBetweenActs, swFabricMemWwn=swFabricMemWwn, swFCPortTxWords=swFCPortTxWords, swConnUnitPortStatExtentionTable=swConnUnitPortStatExtentionTable, swConnUnitTimedOut=swConnUnitTimedOut, swTrunkGrpTx=swTrunkGrpTx, swNbIndex=swNbIndex, swNbIslState=swNbIslState, swBlmPerfFltAlias=swBlmPerfFltAlias, swMemPollingInterval=swMemPollingInterval, swIPv6Status=swIPv6Status, swFabricMemType=swFabricMemType, swFwCustBufSize=swFwCustBufSize, swFCPortWwn=swFCPortWwn, swFCPortLinkState=swFCPortLinkState, swEventTrap=swEventTrap, swFCPortFlag=swFCPortFlag, swConnUnitStateChange=swConnUnitStateChange, swFwDefaultBufSize=swFwDefaultBufSize, swNsIPA=swNsIPA, swDiagResult=swDiagResult, swNbBaudRate=swNbBaudRate, swFwDefaultHigh=swFwDefaultHigh, swNsLocalTable=swNsLocalTable, swConnUnitProcRequired=swConnUnitProcRequired, swAgtCfg=swAgtCfg, swFCPortOpStatus=swFCPortOpStatus, swFabricMemGWIP=swFabricMemGWIP, swAgtCmtyTable=swAgtCmtyTable, swFCPortRxLCs=swFCPortRxLCs, swFwCurVal=swFwCurVal, swFabricMemEIP=swFabricMemEIP, swConnUnitLli=swConnUnitLli, swPmgrEventDescr=swPmgrEventDescr, SwFwStatus=SwFwStatus, swTopTalkerMntTable=swTopTalkerMntTable, swGroupMemTable=swGroupMemTable, swPmgrEventType=swPmgrEventType, swFwThresholdTable=swFwThresholdTable, swFabricMemShortVersion=swFabricMemShortVersion, swCpuAction=swCpuAction, swFwBehaviorType=swFwBehaviorType, swFwActLevel=swFwActLevel, swTestString=swTestString, swFCPortRxWords=swFCPortRxWords, swNbRemPort=swNbRemPort, swCurrentDate=swCurrentDate, swFCPortRxTruncs=swFCPortRxTruncs, swStateChangeTrap=swStateChangeTrap, swSensorScn=swSensorScn, swNsLocalNumEntry=swNsLocalNumEntry, swEtherIPAddress=swEtherIPAddress, swFwDefaultAboveActs=swFwDefaultAboveActs, swEndDeviceProtoErr=swEndDeviceProtoErr, swEventTimeInfo=swEventTimeInfo, swConnUnitFTB6Miss=swConnUnitFTB6Miss, swPrincipalSwitch=swPrincipalSwitch, SwFwBehavior=SwFwBehavior, swFwLabel=swFwLabel, swFCPortName=swFCPortName, swEndDeviceLinkFailure=swEndDeviceLinkFailure, swFlashDLHost=swFlashDLHost, swFCPortTxType=swFCPortTxType, swTrunkGrpRx=swTrunkGrpRx, swFwDefaultTimebase=swFwDefaultTimebase, swNsFc4=swNsFc4, swBlmPerfFltRefkey=swBlmPerfFltRefkey, swFCPortRxMcasts=swFCPortRxMcasts, swBrcdGenericTrap=swBrcdGenericTrap, swTopTalkerMntIndex=swTopTalkerMntIndex, swNsNodeSymb=swNsNodeSymb, swBlmPerfFltPort=swBlmPerfFltPort, swFabricMemFCIP=swFabricMemFCIP, swFCPortPrevType=swFCPortPrevType, swMemUsageLimit3=swMemUsageLimit3, swConnUnitFECUnCorrectedCounter=swConnUnitFECUnCorrectedCounter, swPmgrEventTime=swPmgrEventTime, swConnUnitLunZoneMiss=swConnUnitLunZoneMiss, SwFwTimebase=SwFwTimebase, swNbRemPortName=swNbRemPortName, swEndDeviceInvalidCRC=swEndDeviceInvalidCRC, swConnUnitFLNumOfTenancy=swConnUnitFLNumOfTenancy, sw28k=sw28k, swBeaconOperStatus=swBeaconOperStatus, swFCPortScn=swFCPortScn, swFCPortDisableReason=swFCPortDisableReason, swGroupId=swGroupId, swFCPortSpecifier=swFCPortSpecifier, swFCPortRxBadOs=swFCPortRxBadOs, swSensorIndex=swSensorIndex, swFwCustChangedActs=swFwCustChangedActs, SwFwEvent=SwFwEvent, swConnUnitCRCWithBadEOF=swConnUnitCRCWithBadEOF, swEndDeviceRlsTable=swEndDeviceRlsTable, swFwLastEventVal=swFwLastEventVal)
text = '''aaaaaa aaaaaa aaaa aaaa a aa aa a aa0 bbbbbb bbbbbb bbbbbbbbbb.ccc ccccc c0 dddd ddddd ddddd.eeeee eeeeeee.fffff0 fffff fff ffffff.ggg ggg gg g.eeefaa0.''' lines = list(text.split('\n')) words = list(text.split(' ')) sentenses = list(text.split('.')) print(len(lines), lines, '\n') print(len(words), words, '\n') print(len(sentenses), sentenses, '\n') print(len(text))
text = 'aaaaaa aaaaaa aaaa aaaa a aa aa a aa0\nbbbbbb bbbbbb bbbbbbbbbb.ccc ccccc c0\ndddd ddddd ddddd.eeeee eeeeeee.fffff0\nfffff fff ffffff.ggg ggg gg g.eeefaa0.' lines = list(text.split('\n')) words = list(text.split(' ')) sentenses = list(text.split('.')) print(len(lines), lines, '\n') print(len(words), words, '\n') print(len(sentenses), sentenses, '\n') print(len(text))
class BinaryTree: def __init__(self, rootValue): self.value = rootValue self.left = None self.right = None def addLeftChild(self, val): newNode = BinaryTree(val) self.left = newNode def addRightChild(self, val): newNode = BinaryTree(val) self.right = newNode def setLeftChild(self, child): self.left = child def setRightChild(self, child): self.right = child
class Binarytree: def __init__(self, rootValue): self.value = rootValue self.left = None self.right = None def add_left_child(self, val): new_node = binary_tree(val) self.left = newNode def add_right_child(self, val): new_node = binary_tree(val) self.right = newNode def set_left_child(self, child): self.left = child def set_right_child(self, child): self.right = child
#!/usr/bin/env python """Args, Kwargs""" __author__ = "Petar Stoyanov" def main(*args, **kwargs): """Docstring""" for arg in args: print(arg) for (key, value) in kwargs.items(): print("{} - {}".format(key, value)) if __name__ == '__main__': main(1, 2, 3, name='pesho', age=30)
"""Args, Kwargs""" __author__ = 'Petar Stoyanov' def main(*args, **kwargs): """Docstring""" for arg in args: print(arg) for (key, value) in kwargs.items(): print('{} - {}'.format(key, value)) if __name__ == '__main__': main(1, 2, 3, name='pesho', age=30)
#a = 3 #b = 4 #c = a ** b #print (c) #x = 5 #print(x) #x = 5 #x += 3 # #print(x) #x = 5 #x -= 3 # #print(x) #x = 5 #x *= 3 #print(x) #x = 5 #x /= 3 #print(x) #x = 5 #x%=3 #print(x) # comparisin opperraters #x = 5 #y = 3 # #print(x == y) # # returns False because 5 is not equal to 3 #x = 5 #y = 3 # #print(x != y) #x = 5 #y = 3 # #print(x >= y) # # returns True because five is greater, or equal, to 3 x = 5 y = 3 print(x <= y) # returns False because 5 is neither less than or equal to 3
x = 5 y = 3 print(x <= y)
fruit = ["apple", "banana", "peach"] fruit # outputs # >>> ['apple', 'banana', 'peach']
fruit = ['apple', 'banana', 'peach'] fruit
#!/usr/bin/env python #--- Day 6: Universal Orbit Map --- #You've landed at the Universal Orbit Map facility on Mercury. Because navigation in space often involves transferring between orbits, the orbit maps here are useful for finding efficient routes between, for example, you and Santa. You download a map of the local orbits (your puzzle input). #Except for the universal Center of Mass (COM), every object in space is in orbit around exactly one other object. An orbit looks roughly like this: # \ # \ # | # | #AAA--> o o <--BBB # | # | # / # / #In this diagram, the object BBB is in orbit around AAA. The path that BBB takes around AAA (drawn with lines) is only partly shown. In the map data, this orbital relationship is written AAA)BBB, which means "BBB is in orbit around AAA". #Before you use your map data to plot a course, you need to make sure it wasn't corrupted during the download. To verify maps, the Universal Orbit Map facility uses orbit count checksums - the total number of direct orbits (like the one shown above) and indirect orbits. #Whenever A orbits B and B orbits C, then A indirectly orbits C. This chain can be any number of objects long: if A orbits B, B orbits C, and C orbits D, then A indirectly orbits D. #For example, suppose you have the following map: #COM)B #B)C #C)D #D)E #E)F #B)G #G)H #D)I #E)J #J)K #K)L #Visually, the above map of orbits looks like this: # G - H J - K - L # / / #COM - B - C - D - E - F # \ # I #In this visual representation, when two objects are connected by a line, the one on the right directly orbits the one on the left. #Here, we can count the total number of orbits as follows: #* D directly orbits C and indirectly orbits B and COM, a total of 3 orbits. #* L directly orbits K and indirectly orbits J, E, D, C, B, and COM, a total of 7 orbits. #* COM orbits nothing. #The total number of direct and indirect orbits in this example is 42. #What is the total number of direct and indirect orbits in your map data? puzzle_input = [] # 1) read input with open("day06.txt", "r") as file: ### DEBUG INPUT #with open("day06-test.txt", "r") as file: for entry in file.readlines(): puzzle_input.append(entry.rstrip().split(")")) # 1.1) check whether it would be a binary tree or not #checklist = [x[0] for x in split_input] #for x in checklist: # if checklist.count(x) > 2: # print("not binary,", x, "contained more than twice!") ## damn it: not binary, 7LD contained more than twice! ## okay. Let's build a ternary tree... # 2) build a tree from the input data # After having read through some reddit posts looking for help on this one (Python has no native tree structure, I was not able to get anytree do what I wanted it to do, I was not able to get my input into any reasonable structure, ...), I'm afraid I have to take a look at dictionaries again. At least, I already was at the right way of counting things, but without knowledge about how dictionaries work, I couldn't possibly figure out how to set it up properly (and my trials with doing it with lists of lists of lists of lists etc. etc. failed). # every object is key with value being the object that they orbit orbit_dict = {key: value for value, key in puzzle_input} # now, for every object=key, count how many "parents" there are, i.e. look-up the key's value in the keys until COM is reached - and COM is no key, so this will stop the while loop calc_orbits = 0 for obj in orbit_dict.keys(): obj_tmp = obj while obj_tmp in orbit_dict: calc_orbits += 1 obj_tmp = orbit_dict[obj_tmp] print(calc_orbits) ### DEBUG OUTPUT print(puzzle_input[0:5]) #print(orbit_dict)
puzzle_input = [] with open('day06.txt', 'r') as file: for entry in file.readlines(): puzzle_input.append(entry.rstrip().split(')')) orbit_dict = {key: value for (value, key) in puzzle_input} calc_orbits = 0 for obj in orbit_dict.keys(): obj_tmp = obj while obj_tmp in orbit_dict: calc_orbits += 1 obj_tmp = orbit_dict[obj_tmp] print(calc_orbits) print(puzzle_input[0:5])
""" Classes which create external representations of core objects. This allows the core objects to remain decoupled from the API and clients. These classes act as an adapter between the data format api clients expect, and the internal data of an object. """
""" Classes which create external representations of core objects. This allows the core objects to remain decoupled from the API and clients. These classes act as an adapter between the data format api clients expect, and the internal data of an object. """
def print_name(prefix): print("searchingname with" + prefix) try: while True: name = (yield) if prefix in name: print(name) except GeneratorExit as identifier: print("Coroutine Exited") corou = print_name("Dear") corou.__next__() corou.send("Atul") corou.send("Dear Atul") corou.close()
def print_name(prefix): print('searchingname with' + prefix) try: while True: name = (yield) if prefix in name: print(name) except GeneratorExit as identifier: print('Coroutine Exited') corou = print_name('Dear') corou.__next__() corou.send('Atul') corou.send('Dear Atul') corou.close()
n = int(input()) s = [1 if element == 'U' else -1 for element in input()] counter = 0 status = 0 step = 0 while step < n: if status == 0 and s[step] == -1: status = 1 start_pt = step step += 1 sum_val = -1 while step < n and status != 0: sum_val += s[step] if sum_val == 0: counter += 1 status = 0 step += 1 elif status == 0 and s[step] == 1: status = -1 start_pt = step step += 1 sum_val = 1 while step < n and status != 0: sum_val += s[step] if sum_val == 0: status = 0 step += 1 print (counter)
n = int(input()) s = [1 if element == 'U' else -1 for element in input()] counter = 0 status = 0 step = 0 while step < n: if status == 0 and s[step] == -1: status = 1 start_pt = step step += 1 sum_val = -1 while step < n and status != 0: sum_val += s[step] if sum_val == 0: counter += 1 status = 0 step += 1 elif status == 0 and s[step] == 1: status = -1 start_pt = step step += 1 sum_val = 1 while step < n and status != 0: sum_val += s[step] if sum_val == 0: status = 0 step += 1 print(counter)
''' Author: tusikalanse Date: 2021-07-10 18:07:33 LastEditTime: 2021-07-10 18:10:07 LastEditors: tusikalanse Description: ''' cnt = 0 def gao(i: int) -> int: for _ in range(50): i = i + int(str(i)[::-1]) if str(i) == str(i)[::-1]: return 0 return 1 for i in range(10000): cnt += gao(i) print(cnt)
""" Author: tusikalanse Date: 2021-07-10 18:07:33 LastEditTime: 2021-07-10 18:10:07 LastEditors: tusikalanse Description: """ cnt = 0 def gao(i: int) -> int: for _ in range(50): i = i + int(str(i)[::-1]) if str(i) == str(i)[::-1]: return 0 return 1 for i in range(10000): cnt += gao(i) print(cnt)
# To demonstrate, we insert the number 8 to specify the available space for the value. # Use "=" to place the plus/minus sign at the left most position: txt = "The temperature is {:=8} degrees celsius." print(txt.format(-5))
txt = 'The temperature is {:=8} degrees celsius.' print(txt.format(-5))
# Given a sentence, reverse each word in the sentence while keeping the order the same! # Code def word_flipper(our_string): """ Flip the individual words in a sentence Args: our_string(string): String with words to flip Returns: string: String with words flipped """ split = our_string.split(" ") retval = [] for s in split: retval.append(s[::-1]) retvalstr = " ".join(retval) return retvalstr # Test Cases print ("Pass" if ('retaw' == word_flipper('water')) else "Fail") print ("Pass" if ('sihT si na elpmaxe' == word_flipper('This is an example')) else "Fail") print ("Pass" if ('sihT si eno llams pets rof ...' == word_flipper('This is one small step for ...')) else "Fail")
def word_flipper(our_string): """ Flip the individual words in a sentence Args: our_string(string): String with words to flip Returns: string: String with words flipped """ split = our_string.split(' ') retval = [] for s in split: retval.append(s[::-1]) retvalstr = ' '.join(retval) return retvalstr print('Pass' if 'retaw' == word_flipper('water') else 'Fail') print('Pass' if 'sihT si na elpmaxe' == word_flipper('This is an example') else 'Fail') print('Pass' if 'sihT si eno llams pets rof ...' == word_flipper('This is one small step for ...') else 'Fail')
""" sort and two pointers (twosum2) """ class Solution(object): def threeSum(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ result = [] nums.sort() for i in range(len(nums)): if i > 0 and nums[i] == nums[i-1]: continue left = i+1 right = len(nums)-1 while left < right: cur_sum = nums[i] + nums[left] + nums[right] if cur_sum > 0: right -=1 elif cur_sum < 0: left +=1 else: result.append([nums[i],nums[left],nums[right]]) left +=1 while nums[left] == nums[left-1] and left < right: left +=1 return result
""" sort and two pointers (twosum2) """ class Solution(object): def three_sum(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ result = [] nums.sort() for i in range(len(nums)): if i > 0 and nums[i] == nums[i - 1]: continue left = i + 1 right = len(nums) - 1 while left < right: cur_sum = nums[i] + nums[left] + nums[right] if cur_sum > 0: right -= 1 elif cur_sum < 0: left += 1 else: result.append([nums[i], nums[left], nums[right]]) left += 1 while nums[left] == nums[left - 1] and left < right: left += 1 return result
''' Flask config. ''' display = {} CREDS_PATH = "app/creds.txt" TEMPLATES_AUTO_RELOAD = True
""" Flask config. """ display = {} creds_path = 'app/creds.txt' templates_auto_reload = True
# equation constants # gas diffusivity CONST_EQ_GAS_DIFFUSIVITY = { "Chapman-Enskog": 1, "Wilke-Lee": 2 } # gas viscosity CONST_EQ_GAS_VISCOSITY = { "eq1": 1, "eq2": 2 } # sherwood number CONST_EQ_Sh = { "Frossling": 1, "Rosner": 2, "Garner-and-Keey": 3 } # thermal conductivity CONST_EQ_GAS_THERMAL_CONDUCTIVITY = { "eq1": 1, "eq2": 2 }
const_eq_gas_diffusivity = {'Chapman-Enskog': 1, 'Wilke-Lee': 2} const_eq_gas_viscosity = {'eq1': 1, 'eq2': 2} const_eq__sh = {'Frossling': 1, 'Rosner': 2, 'Garner-and-Keey': 3} const_eq_gas_thermal_conductivity = {'eq1': 1, 'eq2': 2}
#shape of rectangle: def for_rectangle(): """printing shape of'rectangle' using for loop""" for row in range(5): for col in range(11): if row in(0,4) or col in(0,10): print("*",end=" ") else: print(" ",end=" ") print() def while_rectangle(): """printing shape of'rectangle' using while loop""" i=0 while i<5: j=0 while j<11: if i in(0,4) or j in(0,10): print("*",end=" ") else: print(" ",end=" ") j+=1 print() i+=1
def for_rectangle(): """printing shape of'rectangle' using for loop""" for row in range(5): for col in range(11): if row in (0, 4) or col in (0, 10): print('*', end=' ') else: print(' ', end=' ') print() def while_rectangle(): """printing shape of'rectangle' using while loop""" i = 0 while i < 5: j = 0 while j < 11: if i in (0, 4) or j in (0, 10): print('*', end=' ') else: print(' ', end=' ') j += 1 print() i += 1
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] list = [] num = int(input('check wich number is smaller than : ')) for x in a: if x < num: list.append(x) # print(x) print(list)
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] list = [] num = int(input('check wich number is smaller than : ')) for x in a: if x < num: list.append(x) print(list)
# Write a function named combine_sort that has two parameters named lst1 and lst2. # The function should combine these two lists into one new list and sort the result. Return the new sorted list. #print(combine_sort([4, 10, 2, 5], [-10, 2, 5, 10])) def combine_sort(lst1, lst2): new_lst = lst1 + lst2 return sorted(new_lst) print(combine_sort([4, 10, 2, 5], [-10, 2, 5, 10]))
def combine_sort(lst1, lst2): new_lst = lst1 + lst2 return sorted(new_lst) print(combine_sort([4, 10, 2, 5], [-10, 2, 5, 10]))
input_line_number = 0 lines = [] def input(): global input_line_number input_line_number += 1 return lines[input_line_number - 1] def solution(): # Solution starts here number_of_lines = int(input()) for i in range(0, number_of_lines): full_name = input() # Find the location of the first space so we can differentiate first and last name space_index = full_name.index(" ") first_name = full_name[:space_index] last_name = full_name[space_index + 1:].replace(' ', '') # Replace spaces by nothing == removing all spaces print('{}{}'.format(first_name[0].lower(), last_name[:4].lower())) """ REMARK: You can take a substring with an index that is larger than the string's length """ # Solution ends here if __name__ == '__main__': with open('resources/input_username.txt') as file: lines = file.readlines() lines = [line.rstrip() for line in lines] solution()
input_line_number = 0 lines = [] def input(): global input_line_number input_line_number += 1 return lines[input_line_number - 1] def solution(): number_of_lines = int(input()) for i in range(0, number_of_lines): full_name = input() space_index = full_name.index(' ') first_name = full_name[:space_index] last_name = full_name[space_index + 1:].replace(' ', '') print('{}{}'.format(first_name[0].lower(), last_name[:4].lower())) " REMARK: You can take a substring with an index that is larger than the string's length " if __name__ == '__main__': with open('resources/input_username.txt') as file: lines = file.readlines() lines = [line.rstrip() for line in lines] solution()
# 104. Maximum Depth of Binary Tree """ Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. """ # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def maxDepth(self, root: Optional[TreeNode]) -> int: def helper(value): if not value: return 0 else: return 1 + (max(helper(value.left), helper(value.right))) return helper(root)
""" Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. """ class Solution: def max_depth(self, root: Optional[TreeNode]) -> int: def helper(value): if not value: return 0 else: return 1 + max(helper(value.left), helper(value.right)) return helper(root)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 26 20:46:03 2018 @author: daniel cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4. Given this implementation of cons: def cons(a, b): def pair(f): return f(a, b) return pair Implement car and cdr. """ def cons(a, b): def pair(f): return f(a, b) return pair def car(pair): def f(a, b): return a return pair(f) def cdr(pair): def f(a, b): return b return pair(f) assert car(cons(3, 4)) == 3 assert cdr(cons(3, 4)) == 4 print('all fine')
""" Created on Wed Sep 26 20:46:03 2018 @author: daniel cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4. Given this implementation of cons: def cons(a, b): def pair(f): return f(a, b) return pair Implement car and cdr. """ def cons(a, b): def pair(f): return f(a, b) return pair def car(pair): def f(a, b): return a return pair(f) def cdr(pair): def f(a, b): return b return pair(f) assert car(cons(3, 4)) == 3 assert cdr(cons(3, 4)) == 4 print('all fine')
# Allows for easier debugging and unit testing. For example in dev mode functions don't expect a Flask request input. DEV_MODE = False KEYFILE = 'keyfile.json'
dev_mode = False keyfile = 'keyfile.json'
class BrokenLinkWarning(UserWarning): """ Raised when a group has a key with a None value. """ pass
class Brokenlinkwarning(UserWarning): """ Raised when a group has a key with a None value. """ pass
elements = [23, 14, 56, 12, 19, 9, 15, 25, 31, 42, 43] l=len(elements) i=0 sum_even=0 sum_odd=0 average_even=0 average_odd=0 while i<l: if elements[i]%2==0: sum_even=sum_even+elements[i] average_even+=1 else: sum_odd=sum_odd+elements[i] average_odd+=1 i+=1 print(sum_even//average_even) print(sum_odd//average_odd)
elements = [23, 14, 56, 12, 19, 9, 15, 25, 31, 42, 43] l = len(elements) i = 0 sum_even = 0 sum_odd = 0 average_even = 0 average_odd = 0 while i < l: if elements[i] % 2 == 0: sum_even = sum_even + elements[i] average_even += 1 else: sum_odd = sum_odd + elements[i] average_odd += 1 i += 1 print(sum_even // average_even) print(sum_odd // average_odd)
""" Session related utilities """ def session(self): """ Simple function that will be bound to the current request object to make the session retrievable inside a handler """ # Returns a session using the default cookie key. return self.session_store.get_session()
""" Session related utilities """ def session(self): """ Simple function that will be bound to the current request object to make the session retrievable inside a handler """ return self.session_store.get_session()
# for local # It's probably helpful for us to demonstrate what the URL should be, etc. SECRET_KEY = b'keycloak' # http, not https for some reason SERVER_URL = "http://keycloak-idp:8080/auth/" ADMIN_USERNAME = "admin" ADMIN_PASS = "admin" REALM_NAME = "master" # created in keycloak per https://github.com/keycloak/keycloak-documentation/blob/main/securing_apps/topics/client-registration/client-registration-cli.adoc CLIENT_ID = "keycloak-flask" # set access-type to confidential, save, reload, will see a credentials tab where you can set this CLIENT_SECRET = "2da4a9a4-f6f0-48d9-82f6-12012402f03a" # You'll probably have to tell docker this is OK on a Mac INGRESS_HOST = "http://www.google.com/"
secret_key = b'keycloak' server_url = 'http://keycloak-idp:8080/auth/' admin_username = 'admin' admin_pass = 'admin' realm_name = 'master' client_id = 'keycloak-flask' client_secret = '2da4a9a4-f6f0-48d9-82f6-12012402f03a' ingress_host = 'http://www.google.com/'
# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. def print_hi(iname): # Use a breakpoint in the code line below to debug your script. print(f'Hi, {iname}') # Press Ctrl+F8 to toggle the breakpoint. print_hi("hi pycharm") def days_to_hour(num_of_days): calc_to_units = 24 name_of_units = 'hours' return f"{num_of_days} days to {name_of_units} are {num_of_days*calc_to_units} {name_of_units}" def validate_user_input(): try: user_input_days = int(user_input) if user_input_days > 0: results = days_to_hour(user_input_days) print(results) elif user_input_days == 0: print("please enter valid positive number, 0 can not be converted") else: print("negative number not allowed") except ValueError: print("your input is not a valid number") user_input = "" while user_input != 'exit': user_input = (input("provide number of day to convert!\n")) validate_user_input() # Press the green button in the gutter to run the script. # See PyCharm help at https://www.jetbrains.com/help/pycharm/
def print_hi(iname): print(f'Hi, {iname}') print_hi('hi pycharm') def days_to_hour(num_of_days): calc_to_units = 24 name_of_units = 'hours' return f'{num_of_days} days to {name_of_units} are {num_of_days * calc_to_units} {name_of_units}' def validate_user_input(): try: user_input_days = int(user_input) if user_input_days > 0: results = days_to_hour(user_input_days) print(results) elif user_input_days == 0: print('please enter valid positive number, 0 can not be converted') else: print('negative number not allowed') except ValueError: print('your input is not a valid number') user_input = '' while user_input != 'exit': user_input = input('provide number of day to convert!\n') validate_user_input()
"""Consts for the integration.""" DOMAIN = "sleep_as_android" DEVICE_MACRO: str = "%%%device%%%" DEFAULT_NAME = "SleepAsAndroid" DEFAULT_TOPIC_TEMPLATE = "SleepAsAndroid/%s" % DEVICE_MACRO DEFAULT_QOS = 0 DEFAULT_ALARM_LABEL = "" CONF_ALARMS = "alarms" CONF_ALARM_TIME_FMT = "%H:%M" CONF_ALARM_DATE_FMT = "%Y-%m-%d" CONF_ALARM_LABEL = "label" CONF_ALARM_TIME = "time" CONF_ALARM_DATE = "date" CONF_ALARM_REPEAT = "repeat" CONF_ALARM_ADD_ANOTHER = "add_another"
"""Consts for the integration.""" domain = 'sleep_as_android' device_macro: str = '%%%device%%%' default_name = 'SleepAsAndroid' default_topic_template = 'SleepAsAndroid/%s' % DEVICE_MACRO default_qos = 0 default_alarm_label = '' conf_alarms = 'alarms' conf_alarm_time_fmt = '%H:%M' conf_alarm_date_fmt = '%Y-%m-%d' conf_alarm_label = 'label' conf_alarm_time = 'time' conf_alarm_date = 'date' conf_alarm_repeat = 'repeat' conf_alarm_add_another = 'add_another'
pi=22/7 r=float(input("enter radius of circle")) Area=pi*r*r print("Area of circle:%f",Area)
pi = 22 / 7 r = float(input('enter radius of circle')) area = pi * r * r print('Area of circle:%f', Area)
def upload(task_id, file_id, remote_path): global responses remote_path = remote_path.replace("\\", "") upload = { 'action': "upload", 'file_id': file_id, 'chunk_size': 512000, 'chunk_num': 1, 'full_path': "", 'task_id': task_id, } res = send(upload, agent.get_UUID()) res = res['chunk_data'] response_bytes = res.encode('utf-8') response_decode = base64.b64decode(response_bytes) code = response_decode.decode('utf-8') f = open(remote_path, "w") f.write(code) f.close() response = { 'task_id': task_id, "user_output": "File Uploaded", 'completed': True } responses.append(response) print("\t- Upload Done") return
def upload(task_id, file_id, remote_path): global responses remote_path = remote_path.replace('\\', '') upload = {'action': 'upload', 'file_id': file_id, 'chunk_size': 512000, 'chunk_num': 1, 'full_path': '', 'task_id': task_id} res = send(upload, agent.get_UUID()) res = res['chunk_data'] response_bytes = res.encode('utf-8') response_decode = base64.b64decode(response_bytes) code = response_decode.decode('utf-8') f = open(remote_path, 'w') f.write(code) f.close() response = {'task_id': task_id, 'user_output': 'File Uploaded', 'completed': True} responses.append(response) print('\t- Upload Done') return
#!/usr/bin/env python def constructCDS(features, coordinates): exonCoordinates = [coordinates[featureIndex] for featureIndex in range(len(features)) if features[featureIndex][1] == "e"] cdsMap = {} cdsStart = 1 for exonCoord in exonCoordinates: exonStart, exonEnd = exonCoord cdsEnd = cdsStart + (exonEnd - exonStart) cdsMap[(exonStart, exonEnd)] = (cdsStart,cdsEnd) cdsStart = cdsEnd + 1 return cdsMap def transformPos(pos_orig, cdsMap, sum_deletes_before, sum_inserts_before, sum_cds_deletes_before, sum_cds_inserts_before): pos = pos_orig - sum_deletes_before cdsRegions = list(cdsMap.keys()) cdsRegions.sort() for region in cdsRegions: if (pos >= region[0]) and (pos <= region[1]): newRegion = cdsMap[region] newPosition = newRegion[0] + (pos - region[0]) - sum_cds_inserts_before + sum_cds_deletes_before codonIndex = newPosition / 3 # codon length = 3 return (newPosition, codonIndex) return (pos_orig - sum_inserts_before, None) def changeToImgtCoords(features, coordinates, differences, utr5Length = 0): cdsMap = constructCDS(features, coordinates) imgtDifferences = {} imgtCoordinates = [] for key in ["deletionPositions", "insertionPositions", "mismatchPositions"]: imgtDifferences[key] = [] utr5Index = features.index("utr5") utr5Start, utr5End = coordinates[utr5Index][0], coordinates[utr5Index][1] utr5Length = utr5End - utr5Start + 1 for featureIndex in range(len(features)): feature = features[featureIndex] if feature == "utr5": ft_start = coordinates[featureIndex][0] - (utr5Length + 1) ft_end = coordinates[featureIndex][1] - (utr5Length + 1) else: ft_start = coordinates[featureIndex][0] - utr5Length ft_end = coordinates[featureIndex][1] - utr5Length imgtCoordinates.append((ft_start, ft_end)) # shift positions for preceding inDels: ins_in_cds = [] del_in_cds = [] for key in ["deletionPositions", "insertionPositions", "mismatchPositions"]: imgtDifferences[key] = [] new_diff = [] for pos in differences[key]: sum_deletes_before = sum([1 for posx in differences["deletionPositions"] if posx < pos]) sum_cds_deletes_before = sum([1 for posx in differences["deletionPositions"] if posx < pos and posx in del_in_cds]) sum_inserts_before = sum([1 for posx in differences["insertionPositions"] if posx < pos]) sum_cds_inserts_before = sum([1 for posx in differences["insertionPositions"] if posx < pos and posx in ins_in_cds]) newpos = transformPos(pos, cdsMap, sum_deletes_before, sum_inserts_before, sum_cds_deletes_before, sum_cds_inserts_before) imgtDifferences[key].append(newpos) # print(key, pos, sum_inserts_before, sum_deletes_before, sum_cds_deletes_before, sum_cds_inserts_before, newpos) # adjust differences[key] for preceding insertions: if newpos[1]: # if change located in CDS new_diff.append(pos) if key == "insertionPositions": ins_in_cds.append(pos) elif key == "deletionPositions": del_in_cds.append(pos) else: new_diff.append(newpos[0]) differences[key] = new_diff for key in ["mismatches", "insertions", "deletions"]: imgtDifferences[key] = differences[key] return (imgtCoordinates, imgtDifferences, cdsMap)
def construct_cds(features, coordinates): exon_coordinates = [coordinates[featureIndex] for feature_index in range(len(features)) if features[featureIndex][1] == 'e'] cds_map = {} cds_start = 1 for exon_coord in exonCoordinates: (exon_start, exon_end) = exonCoord cds_end = cdsStart + (exonEnd - exonStart) cdsMap[exonStart, exonEnd] = (cdsStart, cdsEnd) cds_start = cdsEnd + 1 return cdsMap def transform_pos(pos_orig, cdsMap, sum_deletes_before, sum_inserts_before, sum_cds_deletes_before, sum_cds_inserts_before): pos = pos_orig - sum_deletes_before cds_regions = list(cdsMap.keys()) cdsRegions.sort() for region in cdsRegions: if pos >= region[0] and pos <= region[1]: new_region = cdsMap[region] new_position = newRegion[0] + (pos - region[0]) - sum_cds_inserts_before + sum_cds_deletes_before codon_index = newPosition / 3 return (newPosition, codonIndex) return (pos_orig - sum_inserts_before, None) def change_to_imgt_coords(features, coordinates, differences, utr5Length=0): cds_map = construct_cds(features, coordinates) imgt_differences = {} imgt_coordinates = [] for key in ['deletionPositions', 'insertionPositions', 'mismatchPositions']: imgtDifferences[key] = [] utr5_index = features.index('utr5') (utr5_start, utr5_end) = (coordinates[utr5Index][0], coordinates[utr5Index][1]) utr5_length = utr5End - utr5Start + 1 for feature_index in range(len(features)): feature = features[featureIndex] if feature == 'utr5': ft_start = coordinates[featureIndex][0] - (utr5Length + 1) ft_end = coordinates[featureIndex][1] - (utr5Length + 1) else: ft_start = coordinates[featureIndex][0] - utr5Length ft_end = coordinates[featureIndex][1] - utr5Length imgtCoordinates.append((ft_start, ft_end)) ins_in_cds = [] del_in_cds = [] for key in ['deletionPositions', 'insertionPositions', 'mismatchPositions']: imgtDifferences[key] = [] new_diff = [] for pos in differences[key]: sum_deletes_before = sum([1 for posx in differences['deletionPositions'] if posx < pos]) sum_cds_deletes_before = sum([1 for posx in differences['deletionPositions'] if posx < pos and posx in del_in_cds]) sum_inserts_before = sum([1 for posx in differences['insertionPositions'] if posx < pos]) sum_cds_inserts_before = sum([1 for posx in differences['insertionPositions'] if posx < pos and posx in ins_in_cds]) newpos = transform_pos(pos, cdsMap, sum_deletes_before, sum_inserts_before, sum_cds_deletes_before, sum_cds_inserts_before) imgtDifferences[key].append(newpos) if newpos[1]: new_diff.append(pos) if key == 'insertionPositions': ins_in_cds.append(pos) elif key == 'deletionPositions': del_in_cds.append(pos) else: new_diff.append(newpos[0]) differences[key] = new_diff for key in ['mismatches', 'insertions', 'deletions']: imgtDifferences[key] = differences[key] return (imgtCoordinates, imgtDifferences, cdsMap)
class CodeParser(): #Parsing variables SPEED = 0 ANGLE = 0 lineNum = 0 #Parsing libraries (or "keywords") PORTS = ["THROTTLE", "TURN"] #Initialize the CodeParser def __init__(self, path): self.SPEED = 0 self.ANGLE = 0 #Open racer file racer = open(path, "r") #Read lines in self.code = racer.readlines() racer.close() #Remove whitespace from file line = 0 while line < len(self.code): terms = self.code[line].split() if len(terms) == 0: self.code.pop(line) else: line += 1 #Analyze def analyzer(self): #Keep reading lines until you run out of lines while self.lineNum < len(self.code): #Split code line into terms terms = self.code[self.lineNum].split() #Go to add function if terms[0] == "add": self.addPort(terms) elif terms[0] == "sub": self.subPort(terms) elif terms[0] == "mpy": self.mpyPort(terms) elif terms[0] == "div": self.divPort(terms) elif terms[0] == "set": self.setPort(terms) elif terms[0] == "jmp": self.jump(terms) elif terms[0] == "lst": self.lstJump(terms) elif terms[0] == "lte": self.lteJump(terms) elif terms[0] == "grt": self.grtJump(terms) elif terms[0] == "gte": self.gteJump(terms) elif terms[0] == "eqt": self.eqtJump(terms) elif terms[0] == "nte": self.nteJump(terms) #Print speed and angle after each line read #print("Speed:", self.SPEED) #print("Angle:", self.ANGLE) self.lineNum += 1 #Function to add number to port def addPort(self, terms): if terms[1] == "THROTTLE": self.SPEED = self.SPEED + int(terms[2]) elif terms[1] == "TURN": self.ANGLE = self.ANGLE + int(terms[2]) #Function to subtract number from port def subPort(self, terms): if terms[1] == "THROTTLE": self.SPEED = self.SPEED - int(terms[2]) elif terms[1] == "TURN": self.ANGLE = self.ANGLE - int(terms[2]) #Function to multply port by number def mpyPort(self, terms): if terms[1] == "THROTTLE": self.SPEED = self.SPEED * int(terms[2]) elif terms[1] == "TURN": self.ANGLE = self.ANGLE * int(terms[2]) #Function to divide port by number def divPort(self, terms): if terms[1] == "THROTTLE": self.SPEED = self.SPEED / int(terms[2]) elif terms[1] == "TURN": self.ANGLE = self.ANGLE / int(terms[2]) #Function to set port to number def setPort(self, terms): if terms[1] == "THROTTLE": self.SPEED = int(terms[2]) elif terms[1] == "TURN": self.ANGLE = int(terms[2]) #Function to jump to spcific line def jump(self, terms): #Find the function to jump to and then set lineNum to where it is in the txt file for num, i in enumerate(self.code): i = self.code[num].split() if i[0] == terms[1]: self.lineNum = num return #Function to change port to number def portToNum(self, terms): for i, _ in enumerate(terms): if terms[i] == "THROTTLE": terms[i] = self.SPEED if terms[i] == "TURN": terms[i] = self.ANGLE #Function to jump if comparison is less than def lstJump(self, terms): self.portToNum(terms) if int(terms[1]) < int(terms[2]): for num, i in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return #Function to jump if comparison is less than or equal to def lteJump(self, terms): self.portToNum(terms) if int(terms[1]) <= int(terms[2]): for num, i in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return #Function to jump if comparison is greater than def grtJump(self, terms): self.portToNum(terms) if int(terms[1]) > int(terms[2]): for num, i in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return #Function to jump if comparison is less than or equal to def gteJump(self, terms): self.portToNum(terms) if int(terms[1]) >= int(terms[2]): for num, i in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return #Function to jump if comparison is equal to def eqtJump(self, terms): self.portToNum(terms) if int(terms[1]) == int(terms[2]): for num, i in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return #Function to jump if comparison is not equal to def nteJump(self, terms): self.portToNum(terms) if int(terms[1]) != int(terms[2]): for num, i in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return #This is just for testing and running the code #CodeParser.analyze()
class Codeparser: speed = 0 angle = 0 line_num = 0 ports = ['THROTTLE', 'TURN'] def __init__(self, path): self.SPEED = 0 self.ANGLE = 0 racer = open(path, 'r') self.code = racer.readlines() racer.close() line = 0 while line < len(self.code): terms = self.code[line].split() if len(terms) == 0: self.code.pop(line) else: line += 1 def analyzer(self): while self.lineNum < len(self.code): terms = self.code[self.lineNum].split() if terms[0] == 'add': self.addPort(terms) elif terms[0] == 'sub': self.subPort(terms) elif terms[0] == 'mpy': self.mpyPort(terms) elif terms[0] == 'div': self.divPort(terms) elif terms[0] == 'set': self.setPort(terms) elif terms[0] == 'jmp': self.jump(terms) elif terms[0] == 'lst': self.lstJump(terms) elif terms[0] == 'lte': self.lteJump(terms) elif terms[0] == 'grt': self.grtJump(terms) elif terms[0] == 'gte': self.gteJump(terms) elif terms[0] == 'eqt': self.eqtJump(terms) elif terms[0] == 'nte': self.nteJump(terms) self.lineNum += 1 def add_port(self, terms): if terms[1] == 'THROTTLE': self.SPEED = self.SPEED + int(terms[2]) elif terms[1] == 'TURN': self.ANGLE = self.ANGLE + int(terms[2]) def sub_port(self, terms): if terms[1] == 'THROTTLE': self.SPEED = self.SPEED - int(terms[2]) elif terms[1] == 'TURN': self.ANGLE = self.ANGLE - int(terms[2]) def mpy_port(self, terms): if terms[1] == 'THROTTLE': self.SPEED = self.SPEED * int(terms[2]) elif terms[1] == 'TURN': self.ANGLE = self.ANGLE * int(terms[2]) def div_port(self, terms): if terms[1] == 'THROTTLE': self.SPEED = self.SPEED / int(terms[2]) elif terms[1] == 'TURN': self.ANGLE = self.ANGLE / int(terms[2]) def set_port(self, terms): if terms[1] == 'THROTTLE': self.SPEED = int(terms[2]) elif terms[1] == 'TURN': self.ANGLE = int(terms[2]) def jump(self, terms): for (num, i) in enumerate(self.code): i = self.code[num].split() if i[0] == terms[1]: self.lineNum = num return def port_to_num(self, terms): for (i, _) in enumerate(terms): if terms[i] == 'THROTTLE': terms[i] = self.SPEED if terms[i] == 'TURN': terms[i] = self.ANGLE def lst_jump(self, terms): self.portToNum(terms) if int(terms[1]) < int(terms[2]): for (num, i) in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return def lte_jump(self, terms): self.portToNum(terms) if int(terms[1]) <= int(terms[2]): for (num, i) in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return def grt_jump(self, terms): self.portToNum(terms) if int(terms[1]) > int(terms[2]): for (num, i) in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return def gte_jump(self, terms): self.portToNum(terms) if int(terms[1]) >= int(terms[2]): for (num, i) in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return def eqt_jump(self, terms): self.portToNum(terms) if int(terms[1]) == int(terms[2]): for (num, i) in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return def nte_jump(self, terms): self.portToNum(terms) if int(terms[1]) != int(terms[2]): for (num, i) in enumerate(self.code): i = self.code[num].split() if i[0] == terms[4]: self.lineNum = num return
# If we want to find the shortest path or any path between 2 nodes # BFS works better # Breadth-First search needs a Queue class Node: def __init__(self, val): self.val = val self.left = None self.right = None def __str__(self): return "Node: {} Left: {} Right:{}".format(self.val, self.left, self.right) def visit(self): print(self.val, end='') # Time: O(n) Space: O(n) # where n == number of nodes def breadth_first_traversal(root): queue = [root] while len(queue) > 0: curr = queue.pop(0) curr.visit() if curr.left is not None: queue.append(curr.left) if curr.right is not None: queue.append(curr.right) # Time: O(n) Space: O(n) # where n == number of nodes def breadth_first_search(root, target): queue = [root] while len(queue) > 0: curr = queue.pop(0) # curr.visit() if curr.val == target: return True if curr.left is not None: queue.append(curr.left) if curr.right is not None: queue.append(curr.right) return False # # a # / \ # b c # / \ \ # d e f a = Node('a') b = Node('b') c = Node('c') d = Node('d') e = Node('e') f = Node('f') a.left = b a.right = c b.left = d b.right = e c.right = f breadth_first_traversal(a) print("Does the tree contein 'e'? ", end='') print(breadth_first_search(a, 'e')) print("Does the tree contein 'z'? ", end='') print(breadth_first_search(a, 'z'))
class Node: def __init__(self, val): self.val = val self.left = None self.right = None def __str__(self): return 'Node: {} Left: {} Right:{}'.format(self.val, self.left, self.right) def visit(self): print(self.val, end='') def breadth_first_traversal(root): queue = [root] while len(queue) > 0: curr = queue.pop(0) curr.visit() if curr.left is not None: queue.append(curr.left) if curr.right is not None: queue.append(curr.right) def breadth_first_search(root, target): queue = [root] while len(queue) > 0: curr = queue.pop(0) if curr.val == target: return True if curr.left is not None: queue.append(curr.left) if curr.right is not None: queue.append(curr.right) return False a = node('a') b = node('b') c = node('c') d = node('d') e = node('e') f = node('f') a.left = b a.right = c b.left = d b.right = e c.right = f breadth_first_traversal(a) print("Does the tree contein 'e'? ", end='') print(breadth_first_search(a, 'e')) print("Does the tree contein 'z'? ", end='') print(breadth_first_search(a, 'z'))
testcases = int(input().strip()) for test in range(testcases): string = input().strip() length = len(string) half_length = length // 2 if length % 2: print(-1) continue letters1 = [0] * 26 letters2 = [0] * 26 ascii_a = ord('a') ascii_string = [ord(c) - ascii_a for c in string] for i in range(half_length): letters1[ascii_string[i]] += 1 letters2[ascii_string[half_length + i]] += 1 counter = 0 for i in range(26): if letters1[i] > letters2[i]: counter += letters1[i] - letters2[i] print(counter)
testcases = int(input().strip()) for test in range(testcases): string = input().strip() length = len(string) half_length = length // 2 if length % 2: print(-1) continue letters1 = [0] * 26 letters2 = [0] * 26 ascii_a = ord('a') ascii_string = [ord(c) - ascii_a for c in string] for i in range(half_length): letters1[ascii_string[i]] += 1 letters2[ascii_string[half_length + i]] += 1 counter = 0 for i in range(26): if letters1[i] > letters2[i]: counter += letters1[i] - letters2[i] print(counter)
w, h, k = list(map(int, input().split())) c=0 for i in range(k): c = c+ ( (h-4*i)*2 +( w - 2-4*i)*2) print(c)
(w, h, k) = list(map(int, input().split())) c = 0 for i in range(k): c = c + ((h - 4 * i) * 2 + (w - 2 - 4 * i) * 2) print(c)
t = int(input()) h = (t // 3600) % 24 m1 = t // 60 % 60 // 10 m2 = t // 60 % 60 % 10 s1 = t % 60 // 10 s2 = t % 10 print(h, ":", m1, m2, ":", s1, s2, sep="")
t = int(input()) h = t // 3600 % 24 m1 = t // 60 % 60 // 10 m2 = t // 60 % 60 % 10 s1 = t % 60 // 10 s2 = t % 10 print(h, ':', m1, m2, ':', s1, s2, sep='')
class Solution: def sumRootToLeaf(self, root: TreeNode) -> int: def sumRootToLeaf(r, s): li, x = [n for n in [r.left, r.right] if n], (s << 1) + r.val return x if not li else sum(sumRootToLeaf(n, x) for n in li) return sumRootToLeaf(root, 0)
class Solution: def sum_root_to_leaf(self, root: TreeNode) -> int: def sum_root_to_leaf(r, s): (li, x) = ([n for n in [r.left, r.right] if n], (s << 1) + r.val) return x if not li else sum((sum_root_to_leaf(n, x) for n in li)) return sum_root_to_leaf(root, 0)
class SymbolTable: def __init__(self): self.table = {'SP': 0, 'LCL': 1, 'ARG': 2, 'THIS': 3, 'THAT': 4, 'R0': 0, 'R1': 1, 'R2': 2, 'R3': 3, 'R4': 4, 'R5': 5, 'R6': 6, 'R7': 7, 'R8': 8, 'R9': 9, 'R10': 10, 'R11': 11, 'R12': 12, 'R13': 13, 'R14': 14, 'R15': 15, 'SCREEN': 16384, 'KBD': 24576} def addEntry(self, symbol, address): self.table[symbol] = address def contains(self, symbol): return symbol in self.table def getAddress(self, symbol): return self.table[symbol]
class Symboltable: def __init__(self): self.table = {'SP': 0, 'LCL': 1, 'ARG': 2, 'THIS': 3, 'THAT': 4, 'R0': 0, 'R1': 1, 'R2': 2, 'R3': 3, 'R4': 4, 'R5': 5, 'R6': 6, 'R7': 7, 'R8': 8, 'R9': 9, 'R10': 10, 'R11': 11, 'R12': 12, 'R13': 13, 'R14': 14, 'R15': 15, 'SCREEN': 16384, 'KBD': 24576} def add_entry(self, symbol, address): self.table[symbol] = address def contains(self, symbol): return symbol in self.table def get_address(self, symbol): return self.table[symbol]
""" stormdrain events SD_bounds_updated Bounds have changed. Typically this happens in response to axes limits changing on a plot, or filtering criteria on a dataset changing. SD_reflow_start and SD_reflow_done These events, which often should follow a SD_bounds_updated event, is used to trigger a reflow of datasets down their pipelines. After all workers using this event complete, SD_reflow_done is sent to indicate that subsequent actions using the data can complete. For instance, a plot could do a final draw, since all artists should have received their updated data at this stage. """ SD_exchanges = { 'SD_bounds_updated':"Bounds instance has been updated", 'SD_reflow_start':"Global data reflow, often follows bounds change", 'SD_reflow_done':"Signals that data reflow is complete; should follows SD_reflow_start", }
""" stormdrain events SD_bounds_updated Bounds have changed. Typically this happens in response to axes limits changing on a plot, or filtering criteria on a dataset changing. SD_reflow_start and SD_reflow_done These events, which often should follow a SD_bounds_updated event, is used to trigger a reflow of datasets down their pipelines. After all workers using this event complete, SD_reflow_done is sent to indicate that subsequent actions using the data can complete. For instance, a plot could do a final draw, since all artists should have received their updated data at this stage. """ sd_exchanges = {'SD_bounds_updated': 'Bounds instance has been updated', 'SD_reflow_start': 'Global data reflow, often follows bounds change', 'SD_reflow_done': 'Signals that data reflow is complete; should follows SD_reflow_start'}
A,B = map(int, input().split()) #A,B = 4, 10 if A > B : print('>') elif A < B : print('<') else: print('==')
(a, b) = map(int, input().split()) if A > B: print('>') elif A < B: print('<') else: print('==')
# @Time: 2022/4/13 11:29 # @Author: chang liu # @Email: chang_liu_tamu@gmail.com # @File:LFU.py class Node: def __init__(self, key=None, val=None): self.val = val self.key = key self.f = 1 self.left = None self.right = None class DLL: def __init__(self): self.size = 0 self.head = Node() self.tail = Node() self.head.left = self.tail self.tail.right = self.head def remove_node(self, node): node.left.right = node.right node.right.left = node.left self.size -= 1 def add_head(self, node): self.head.left.right = node node.left = self.head.left self.head.left = node node.right = self.head self.size += 1 def remove_tail(self): tail = self.tail.right self.remove_node(tail) return tail class LFUCache: ''' referring to discuss board, thanks, stranger ''' def __init__(self, capacity: int): self.capacity = capacity self.cache = {} self.freq_map = {} self.min_freq = None def get(self, key: object) -> object: # print(self.cache) # print(self.freq_map) if key not in self.cache: return -1 val = self.cache[key].val self.update(key, val) return val def put(self, key: int, value: object) -> None: # print(self.freq_map) if self.capacity == 0: return if key in self.cache: self.update(key, value) else: if len(self.cache) == self.capacity: removed = self.freq_map[self.min_freq].remove_tail() del self.cache[removed.key] self.min_freq = 1 new = Node(key, value) if 1 not in self.freq_map: self.freq_map[1] = DLL() self.cache[key] = new self.freq_map[1].add_head(new) def update(self, key, val): ptr = self.cache[key] ptr.val = val f = ptr.f ptr.f += 1 if f + 1 not in self.freq_map: self.freq_map[f + 1] = DLL() self.freq_map[f].remove_node(ptr) self.freq_map[f + 1].add_head(ptr) if self.freq_map[f].size == 0 and self.min_freq == f: self.min_freq += 1 # Your LFUCache object will be instantiated and called as such: # obj = LFUCache(capacity) # param_1 = obj.get(key) # obj.put(key,value) class MyObj: def __init__(self, name): self.name = name def __str__(self): return self.name if __name__ == "__main__": x, y, z = MyObj("x"), MyObj("y"), MyObj("z") assert x is not y and y is not z lfu = LFUCache(2) print(lfu.get(1)) lfu.put(1, x) lfu.put(2, y) print(lfu.get(1)) print(lfu.get(2)) lfu.put(3, z) print(lfu.get(1)) print(lfu.get(3))
class Node: def __init__(self, key=None, val=None): self.val = val self.key = key self.f = 1 self.left = None self.right = None class Dll: def __init__(self): self.size = 0 self.head = node() self.tail = node() self.head.left = self.tail self.tail.right = self.head def remove_node(self, node): node.left.right = node.right node.right.left = node.left self.size -= 1 def add_head(self, node): self.head.left.right = node node.left = self.head.left self.head.left = node node.right = self.head self.size += 1 def remove_tail(self): tail = self.tail.right self.remove_node(tail) return tail class Lfucache: """ referring to discuss board, thanks, stranger """ def __init__(self, capacity: int): self.capacity = capacity self.cache = {} self.freq_map = {} self.min_freq = None def get(self, key: object) -> object: if key not in self.cache: return -1 val = self.cache[key].val self.update(key, val) return val def put(self, key: int, value: object) -> None: if self.capacity == 0: return if key in self.cache: self.update(key, value) else: if len(self.cache) == self.capacity: removed = self.freq_map[self.min_freq].remove_tail() del self.cache[removed.key] self.min_freq = 1 new = node(key, value) if 1 not in self.freq_map: self.freq_map[1] = dll() self.cache[key] = new self.freq_map[1].add_head(new) def update(self, key, val): ptr = self.cache[key] ptr.val = val f = ptr.f ptr.f += 1 if f + 1 not in self.freq_map: self.freq_map[f + 1] = dll() self.freq_map[f].remove_node(ptr) self.freq_map[f + 1].add_head(ptr) if self.freq_map[f].size == 0 and self.min_freq == f: self.min_freq += 1 class Myobj: def __init__(self, name): self.name = name def __str__(self): return self.name if __name__ == '__main__': (x, y, z) = (my_obj('x'), my_obj('y'), my_obj('z')) assert x is not y and y is not z lfu = lfu_cache(2) print(lfu.get(1)) lfu.put(1, x) lfu.put(2, y) print(lfu.get(1)) print(lfu.get(2)) lfu.put(3, z) print(lfu.get(1)) print(lfu.get(3))
# -*- coding: utf-8 -*- # @Time: 2020/7/16 11:36 # @Author: GraceKoo # @File: interview_7.py # @Desc: https://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3?tpId=13&rp=1&ru=%2Fta%2Fcoding-interviews&qr # u=%2Fta%2Fcoding-interviews%2Fquestion-ranking class Solution: def fib(self, N: int) -> int: if N <= 1: return N f_dict = {0: 0, 1: 1} for i in range(2, N): f_dict[i] = f_dict[i - 1] + f_dict[i - 2] return f_dict[N - 1] so = Solution() print(so.fib(4))
class Solution: def fib(self, N: int) -> int: if N <= 1: return N f_dict = {0: 0, 1: 1} for i in range(2, N): f_dict[i] = f_dict[i - 1] + f_dict[i - 2] return f_dict[N - 1] so = solution() print(so.fib(4))
#!/usr/bin/python3 def square_matrix_simple(matrix=[]): if matrix: new = [] for rows in matrix: new.append([n ** 2 for n in rows]) return new
def square_matrix_simple(matrix=[]): if matrix: new = [] for rows in matrix: new.append([n ** 2 for n in rows]) return new
# Adaptive Card Design Schema for a sample form. # To learn more about designing and working with buttons and cards, # checkout https://developer.webex.com/docs/api/guides/cards BUSY_CARD_CONTENT = { "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.2", "body": [ { "type": "ColumnSet", "columns": [ { "type": "Column", "width": 1, "items": [ { "type": "Image", "url": "https://i.postimg.cc/2jMv5kqt/AS89975.jpg", "size": "Stretch" } ] }, { "type": "Column", "width": 1, "items": [ { "type": "TextBlock", "text": "Working on it....", "color": "Dark", "weight": "Bolder", "wrap": True, "size": "default", "horizontalAlignment": "Center" }, { "type": "TextBlock", "text": "I am busy working on your request. Please continue to look busy while I do your work.", "color": "Dark", "height": "stretch", "wrap": True } ] } ] } ] }
busy_card_content = {'$schema': 'http://adaptivecards.io/schemas/adaptive-card.json', 'type': 'AdaptiveCard', 'version': '1.2', 'body': [{'type': 'ColumnSet', 'columns': [{'type': 'Column', 'width': 1, 'items': [{'type': 'Image', 'url': 'https://i.postimg.cc/2jMv5kqt/AS89975.jpg', 'size': 'Stretch'}]}, {'type': 'Column', 'width': 1, 'items': [{'type': 'TextBlock', 'text': 'Working on it....', 'color': 'Dark', 'weight': 'Bolder', 'wrap': True, 'size': 'default', 'horizontalAlignment': 'Center'}, {'type': 'TextBlock', 'text': 'I am busy working on your request. Please continue to look busy while I do your work.', 'color': 'Dark', 'height': 'stretch', 'wrap': True}]}]}]}
""" This Module is not yet correct!! """ class TypedCollectionCreator(object): """ Class enforcing that the iterable only contains elements of the given type (or subclasses) at initialisation. That is, checks in the __new__ function that only elements of the given dtype are contained in the given sequence. It also stores the dtype in the dtype property. **Note:** This class is designed to be used in multiple inheritance in the form: 'class X(TypedCollectionCreator, some_builtin_collection)' """ #__slots__ = ('_dtype',) def __new__(cls, dtype: type, sequence=()): if not isinstance(dtype, type): raise TypeError("t must be a type but was "+repr(dtype)) if not all((isinstance(e, dtype) for e in sequence)): raise TypeError("All elements must be instance of {}".format(dtype)) inst = super().__new__(cls, sequence) inst._dtype = dtype return inst @property def dtype(self): return self._dtype def __repr__(self): return '{name}{dtype}({elems})'.format(name=self.__class__.__name__, dtype=repr(self.dtype), elems=', '.join(repr(e) for e in self)) class TypedMutableCollectionCreator(TypedCollectionCreator): """ Class calling the super __init__ with the given sequence argument. """ __slots__ = () def __init__(self, dtype: type, sequence=()): super().__init__(sequence) class TypedFrozenSet(TypedCollectionCreator, frozenset): """frozenset containing only elements of a given type >>> TypedFrozenSet(int, (1, 3, 4)) TypedFrozenSet<class 'int'>(1, 3, 4) >>> TypedFrozenSet(int, (1, 3, 4, 's')) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> TypedFrozenSet(int, (1, 3, 4)) | TypedFrozenSet(int, (5, 6, 7)) TypedFrozenSet<class 'int'>(1, 3, 4, 5, 6, 7) >>> TypedFrozenSet(int, (1, 3, 4)).union( TypedFrozenSet(int, (5, 6, 7))) TypedFrozenSet<class 'int'>(1, 3, 4, 5, 6, 7) """ __slots__ = () class TypedSet(TypedMutableCollectionCreator, set): """(mutable) set containing only elements of the given type >>> TypedSet(int, (1, 3, 4)) TypedSet<class 'int'>(1, 3, 4) >>> TypedSet(int, (1, 3, 4, 's')) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> TypedSet(int, (1, 2, 4)).difference(TypedSet(int, (1, 3, 4, 5))) TypedSet<class 'int'>(2) >>> TypedSet(int, (1, 3, 4)).difference(TypedSet(str, ('a', 'b', 'd'))) TypedSet<class 'int'>(1, 3, 4) >>> TypedSet(int, (1, 3, 4)).intersection(TypedSet(int, (1, 3, 4, 5))) TypedSet<class 'int'>(1, 3, 4) >>> TypedSet(int, (1, 3, 4)).intersection(TypedSet(str, ('a', 'b', 'd'))) TypedSet<class 'int'>() >>> TypedSet(int, (1, 3, 4)).symmetric_difference(TypedSet(int, (1, 3, 4, 5))) TypedSet<class 'int'>(5) >>> TypedSet(int, (1, 3, 4)).symmetric_difference(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> TypedSet(int, (1, 3, 4)).union(TypedSet(int, (1, 3, 4, 5))) TypedSet<class 'int'>(1, 3, 4, 5) >>> TypedSet(int, (1, 3, 4)).union(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> TypedSet(int, (1, 3, 4)).update(TypedSet(int, (1, 3, 4, 5))) >>> TypedSet(int, (1, 3, 4)).update(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: Operation only permitted with a TypedSet of the same type (<class 'int'>) >>> TypedSet(int, (1, 3, 4)).intersection_update(TypedSet(int, (1, 3, 4, 5))) >>> TypedSet(int, (1, 3, 4)).intersection_update(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: Operation only permitted with a TypedSet of the same type (<class 'int'>) >>> TypedSet(int, (1, 3, 4)).difference_update(TypedSet(int, (1, 3, 4, 5))) >>> TypedSet(int, (1, 3, 4)).difference_update(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: Operation only permitted with a TypedSet of the same type (<class 'int'>) >>> TypedSet(int, (1, 3, 4)).symmetric_difference_update(TypedSet(int, (1, 3, 4, 5))) >>> TypedSet(int, (1, 3, 4)).symmetric_difference_update(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: Operation only permitted with a TypedSet of the same type (<class 'int'>) >>> TypedSet(int, (1, 3, 4)).add(5) >>> TypedSet(int, (1, 3, 4)).add('d') Traceback (most recent call last): ... TypeError: elem must be of type <class 'int'> """ __slots__ = () def difference(self, *others): sup = super().difference(*others) return TypedSet(self._dtype, sup) def intersection(self, *others): sup = super().intersection(*others) return TypedSet(self._dtype, sup) def symmetric_difference(self, other): sup = super().symmetric_difference(other) return TypedSet(self._dtype, sup) def union(self, *others): sup = super().union(*others) return TypedSet(self._dtype, sup) def _check_same_type(self, *others): if not all((isinstance(o, TypedSet) and o.dtype == self.dtype for o in others)): raise TypeError("Operation only permitted with a TypedSet of the same type ({})".format(self._dtype)) return True def update(self, *others): self._check_same_type(*others) return super().update(*others) def intersection_update(self, *others): self._check_same_type(*others) return super().intersection_update(*others) def difference_update(self, *others): self._check_same_type(*others) return super().difference_update(*others) def symmetric_difference_update(self, other): self._check_same_type(other) return super().symmetric_difference_update(other) def add(self, elem): if not isinstance(elem, self._dtype): raise TypeError("elem must be of type {}".format(self._dtype)) return super().add(elem) class TypedTuple(TypedCollectionCreator, tuple): """tuple containing only elements of a given type >>> TypedTuple(int, (1, 3, 4)) TypedTuple<class 'int'>(1, 3, 4) >>> TypedTuple(int, (1, 3, 4, 's')) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> TypedTuple(int, (1, 3, 4)) + TypedTuple(int, (1, 3, 4)) TypedTuple<class 'int'>(1, 3, 4, 1, 3, 4) """ __slots__ = () class TypedList(TypedMutableCollectionCreator, list): """ >>> TypedList(int, (1, 3, 4)) TypedList([1, 3, 4]) >>> TypedList(int, (1, 3, 4, 's')) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> tl = TypedList(int, (1, 2, 4)) >>> tl.append(3) >>> tl TypedList([1, 2, 4, 3]) >>> TypedList(int, (1, 3, 4)).append('a') Traceback (most recent call last): ... TypeError: elem must be of type <class 'int'>, but was <class 'str'> >>> TypedList(int, (1, 2, 4))[0] 1 >>> tl = TypedList(int, (1, 3, 4)) >>> tl[2] = 10 >>> tl[2] == 10 True >>> tl = TypedList(int, (1, 3, 4)) >>> tl[2] = 'a' Traceback (most recent call last): ... TypeError: value must be of type <class 'int'> >>> TypedList(int, (1, 3, 4)) + TypedList(int, (1, 3, 4)) TypedList([1, 3, 4, 1, 3, 4]) """ __slots__ = () def append(self, elem): if not isinstance(elem, self._dtype): raise TypeError("elem must be of type {}, but was {}".format(self._dtype, elem.__class__)) return super().append(elem) def __setitem__(self, key, value): if not isinstance(value, self._dtype): raise TypeError("value must be of type {}".format(self._dtype)) return super().__setitem__(key, value)
""" This Module is not yet correct!! """ class Typedcollectioncreator(object): """ Class enforcing that the iterable only contains elements of the given type (or subclasses) at initialisation. That is, checks in the __new__ function that only elements of the given dtype are contained in the given sequence. It also stores the dtype in the dtype property. **Note:** This class is designed to be used in multiple inheritance in the form: 'class X(TypedCollectionCreator, some_builtin_collection)' """ def __new__(cls, dtype: type, sequence=()): if not isinstance(dtype, type): raise type_error('t must be a type but was ' + repr(dtype)) if not all((isinstance(e, dtype) for e in sequence)): raise type_error('All elements must be instance of {}'.format(dtype)) inst = super().__new__(cls, sequence) inst._dtype = dtype return inst @property def dtype(self): return self._dtype def __repr__(self): return '{name}{dtype}({elems})'.format(name=self.__class__.__name__, dtype=repr(self.dtype), elems=', '.join((repr(e) for e in self))) class Typedmutablecollectioncreator(TypedCollectionCreator): """ Class calling the super __init__ with the given sequence argument. """ __slots__ = () def __init__(self, dtype: type, sequence=()): super().__init__(sequence) class Typedfrozenset(TypedCollectionCreator, frozenset): """frozenset containing only elements of a given type >>> TypedFrozenSet(int, (1, 3, 4)) TypedFrozenSet<class 'int'>(1, 3, 4) >>> TypedFrozenSet(int, (1, 3, 4, 's')) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> TypedFrozenSet(int, (1, 3, 4)) | TypedFrozenSet(int, (5, 6, 7)) TypedFrozenSet<class 'int'>(1, 3, 4, 5, 6, 7) >>> TypedFrozenSet(int, (1, 3, 4)).union( TypedFrozenSet(int, (5, 6, 7))) TypedFrozenSet<class 'int'>(1, 3, 4, 5, 6, 7) """ __slots__ = () class Typedset(TypedMutableCollectionCreator, set): """(mutable) set containing only elements of the given type >>> TypedSet(int, (1, 3, 4)) TypedSet<class 'int'>(1, 3, 4) >>> TypedSet(int, (1, 3, 4, 's')) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> TypedSet(int, (1, 2, 4)).difference(TypedSet(int, (1, 3, 4, 5))) TypedSet<class 'int'>(2) >>> TypedSet(int, (1, 3, 4)).difference(TypedSet(str, ('a', 'b', 'd'))) TypedSet<class 'int'>(1, 3, 4) >>> TypedSet(int, (1, 3, 4)).intersection(TypedSet(int, (1, 3, 4, 5))) TypedSet<class 'int'>(1, 3, 4) >>> TypedSet(int, (1, 3, 4)).intersection(TypedSet(str, ('a', 'b', 'd'))) TypedSet<class 'int'>() >>> TypedSet(int, (1, 3, 4)).symmetric_difference(TypedSet(int, (1, 3, 4, 5))) TypedSet<class 'int'>(5) >>> TypedSet(int, (1, 3, 4)).symmetric_difference(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> TypedSet(int, (1, 3, 4)).union(TypedSet(int, (1, 3, 4, 5))) TypedSet<class 'int'>(1, 3, 4, 5) >>> TypedSet(int, (1, 3, 4)).union(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> TypedSet(int, (1, 3, 4)).update(TypedSet(int, (1, 3, 4, 5))) >>> TypedSet(int, (1, 3, 4)).update(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: Operation only permitted with a TypedSet of the same type (<class 'int'>) >>> TypedSet(int, (1, 3, 4)).intersection_update(TypedSet(int, (1, 3, 4, 5))) >>> TypedSet(int, (1, 3, 4)).intersection_update(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: Operation only permitted with a TypedSet of the same type (<class 'int'>) >>> TypedSet(int, (1, 3, 4)).difference_update(TypedSet(int, (1, 3, 4, 5))) >>> TypedSet(int, (1, 3, 4)).difference_update(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: Operation only permitted with a TypedSet of the same type (<class 'int'>) >>> TypedSet(int, (1, 3, 4)).symmetric_difference_update(TypedSet(int, (1, 3, 4, 5))) >>> TypedSet(int, (1, 3, 4)).symmetric_difference_update(TypedSet(str, ('a', 'b', 'd'))) Traceback (most recent call last): ... TypeError: Operation only permitted with a TypedSet of the same type (<class 'int'>) >>> TypedSet(int, (1, 3, 4)).add(5) >>> TypedSet(int, (1, 3, 4)).add('d') Traceback (most recent call last): ... TypeError: elem must be of type <class 'int'> """ __slots__ = () def difference(self, *others): sup = super().difference(*others) return typed_set(self._dtype, sup) def intersection(self, *others): sup = super().intersection(*others) return typed_set(self._dtype, sup) def symmetric_difference(self, other): sup = super().symmetric_difference(other) return typed_set(self._dtype, sup) def union(self, *others): sup = super().union(*others) return typed_set(self._dtype, sup) def _check_same_type(self, *others): if not all((isinstance(o, TypedSet) and o.dtype == self.dtype for o in others)): raise type_error('Operation only permitted with a TypedSet of the same type ({})'.format(self._dtype)) return True def update(self, *others): self._check_same_type(*others) return super().update(*others) def intersection_update(self, *others): self._check_same_type(*others) return super().intersection_update(*others) def difference_update(self, *others): self._check_same_type(*others) return super().difference_update(*others) def symmetric_difference_update(self, other): self._check_same_type(other) return super().symmetric_difference_update(other) def add(self, elem): if not isinstance(elem, self._dtype): raise type_error('elem must be of type {}'.format(self._dtype)) return super().add(elem) class Typedtuple(TypedCollectionCreator, tuple): """tuple containing only elements of a given type >>> TypedTuple(int, (1, 3, 4)) TypedTuple<class 'int'>(1, 3, 4) >>> TypedTuple(int, (1, 3, 4, 's')) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> TypedTuple(int, (1, 3, 4)) + TypedTuple(int, (1, 3, 4)) TypedTuple<class 'int'>(1, 3, 4, 1, 3, 4) """ __slots__ = () class Typedlist(TypedMutableCollectionCreator, list): """ >>> TypedList(int, (1, 3, 4)) TypedList([1, 3, 4]) >>> TypedList(int, (1, 3, 4, 's')) Traceback (most recent call last): ... TypeError: All elements must be instance of <class 'int'> >>> tl = TypedList(int, (1, 2, 4)) >>> tl.append(3) >>> tl TypedList([1, 2, 4, 3]) >>> TypedList(int, (1, 3, 4)).append('a') Traceback (most recent call last): ... TypeError: elem must be of type <class 'int'>, but was <class 'str'> >>> TypedList(int, (1, 2, 4))[0] 1 >>> tl = TypedList(int, (1, 3, 4)) >>> tl[2] = 10 >>> tl[2] == 10 True >>> tl = TypedList(int, (1, 3, 4)) >>> tl[2] = 'a' Traceback (most recent call last): ... TypeError: value must be of type <class 'int'> >>> TypedList(int, (1, 3, 4)) + TypedList(int, (1, 3, 4)) TypedList([1, 3, 4, 1, 3, 4]) """ __slots__ = () def append(self, elem): if not isinstance(elem, self._dtype): raise type_error('elem must be of type {}, but was {}'.format(self._dtype, elem.__class__)) return super().append(elem) def __setitem__(self, key, value): if not isinstance(value, self._dtype): raise type_error('value must be of type {}'.format(self._dtype)) return super().__setitem__(key, value)
# Map by afffsdd # A map with four corners, with bots spawning in each of them. # flake8: noqa # TODO: Format this file. {'spawn': [(1, 1), (14, 1), (15, 1), (16, 1), (17, 1), (1, 2), (1, 3), (1, 4), (17, 14), (17, 15), (17, 16), (1, 17), (2, 17), (3, 17), (4, 17), (17, 17)], 'obstacle': [(0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0), (8, 0), (9, 0), (10, 0), (11, 0), (12, 0), (13, 0), (14, 0), (15, 0), (16, 0), (17, 0), (18, 0), (0, 1), (13, 1), (18, 1), (0, 2), (13, 2), (18, 2), (0, 3), (13, 3), (18, 3), (0, 4), (13, 4), (18, 4), (0, 5), (1, 5), (2, 5), (3, 5), (4, 5), (18, 5), (0, 6), (18, 6), (0, 7), (18, 7), (0, 8), (18, 8), (0, 9), (18, 9), (0, 10), (18, 10), (0, 11), (18, 11), (0, 12), (18, 12), (0, 13), (14, 13), (15, 13), (16, 13), (17, 13), (18, 13), (0, 14), (5, 14), (18, 14), (0, 15), (5, 15), (18, 15), (0, 16), (5, 16), (18, 16), (0, 17), (5, 17), (18, 17), (0, 18), (1, 18), (2, 18), (3, 18), (4, 18), (5, 18), (6, 18), (7, 18), (8, 18), (9, 18), (10, 18), (11, 18), (12, 18), (13, 18), (14, 18), (15, 18), (16, 18), (17, 18), (18, 18)]}
{'spawn': [(1, 1), (14, 1), (15, 1), (16, 1), (17, 1), (1, 2), (1, 3), (1, 4), (17, 14), (17, 15), (17, 16), (1, 17), (2, 17), (3, 17), (4, 17), (17, 17)], 'obstacle': [(0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0), (8, 0), (9, 0), (10, 0), (11, 0), (12, 0), (13, 0), (14, 0), (15, 0), (16, 0), (17, 0), (18, 0), (0, 1), (13, 1), (18, 1), (0, 2), (13, 2), (18, 2), (0, 3), (13, 3), (18, 3), (0, 4), (13, 4), (18, 4), (0, 5), (1, 5), (2, 5), (3, 5), (4, 5), (18, 5), (0, 6), (18, 6), (0, 7), (18, 7), (0, 8), (18, 8), (0, 9), (18, 9), (0, 10), (18, 10), (0, 11), (18, 11), (0, 12), (18, 12), (0, 13), (14, 13), (15, 13), (16, 13), (17, 13), (18, 13), (0, 14), (5, 14), (18, 14), (0, 15), (5, 15), (18, 15), (0, 16), (5, 16), (18, 16), (0, 17), (5, 17), (18, 17), (0, 18), (1, 18), (2, 18), (3, 18), (4, 18), (5, 18), (6, 18), (7, 18), (8, 18), (9, 18), (10, 18), (11, 18), (12, 18), (13, 18), (14, 18), (15, 18), (16, 18), (17, 18), (18, 18)]}
class Node(object): """docstring for Node""" def __init__(self, item, left, right): super(Node, self).__init__() self.item = item self.left = left self.right = right def getChild(self, direction): if (direction > 0): return self.left else: return self.right def getItem(self): return self.item def getLeft(self): return self.left def getRight(self): return self.right def isLeaf(self): return (self.left is None) and (self.right is None) def setChild(self, direction, child): if (direction > 0): self.left = child else: self.right = child def setItem(self, item): self.item = item def setLeft(self, left): self.left = left def setRight(self, right): self.right = right def toStringInorder(self): result = "" if (self.left != None): result += "\n" + self.left.toStringInorder() result += self.item + "\n" if (self.right != None): result += "\n" + self.right.toStringInorder() return result
class Node(object): """docstring for Node""" def __init__(self, item, left, right): super(Node, self).__init__() self.item = item self.left = left self.right = right def get_child(self, direction): if direction > 0: return self.left else: return self.right def get_item(self): return self.item def get_left(self): return self.left def get_right(self): return self.right def is_leaf(self): return self.left is None and self.right is None def set_child(self, direction, child): if direction > 0: self.left = child else: self.right = child def set_item(self, item): self.item = item def set_left(self, left): self.left = left def set_right(self, right): self.right = right def to_string_inorder(self): result = '' if self.left != None: result += '\n' + self.left.toStringInorder() result += self.item + '\n' if self.right != None: result += '\n' + self.right.toStringInorder() return result
#!/usr/bin/env python # -*- coding: utf-8 -*- def cudasolve(A, b, tol=1e-3, normal=False, regA = 1.0, regI = 0.0): """ Conjugate gradient solver for dense system of linear equations. Ax = b Returns: x = A^(-1)b If the system is normal, then it solves (regA*A'A +regI*I)x= b Returns: x = (A'A +reg*I)^(-1)b """ N = len(b) b = b.reshape((N,1)) b_norm = culinalg.norm(b) x = b.copy() if not normal: r = b - culinalg.dot(A,x) else: r = b - regA*culinalg.dot(A,culinalg.dot(A,x), transa='T') - regI*x p = r.copy() rsold = culinalg.dot(r,r, transa='T')[0][0].get() for i in range(N): if not normal: Ap = culinalg.dot(A,p) else: Ap = regA*culinalg.dot(A,culinalg.dot(A,p), transa='T') + regI*p pAp = culinalg.dot(p, Ap, transa='T')[0][0].get() alpha = rsold / pAp x += alpha*p r -= alpha*Ap rsnew = culinalg.dot(r,r, transa='T')[0][0].get() if math.sqrt(rsnew)/b_norm < tol: break else: p = r + (rsnew/rsold)*p rsold = rsnew return x.reshape(N)
def cudasolve(A, b, tol=0.001, normal=False, regA=1.0, regI=0.0): """ Conjugate gradient solver for dense system of linear equations. Ax = b Returns: x = A^(-1)b If the system is normal, then it solves (regA*A'A +regI*I)x= b Returns: x = (A'A +reg*I)^(-1)b """ n = len(b) b = b.reshape((N, 1)) b_norm = culinalg.norm(b) x = b.copy() if not normal: r = b - culinalg.dot(A, x) else: r = b - regA * culinalg.dot(A, culinalg.dot(A, x), transa='T') - regI * x p = r.copy() rsold = culinalg.dot(r, r, transa='T')[0][0].get() for i in range(N): if not normal: ap = culinalg.dot(A, p) else: ap = regA * culinalg.dot(A, culinalg.dot(A, p), transa='T') + regI * p p_ap = culinalg.dot(p, Ap, transa='T')[0][0].get() alpha = rsold / pAp x += alpha * p r -= alpha * Ap rsnew = culinalg.dot(r, r, transa='T')[0][0].get() if math.sqrt(rsnew) / b_norm < tol: break else: p = r + rsnew / rsold * p rsold = rsnew return x.reshape(N)
# MACRO - calculate precision and recall for every class, # then take their weigted sum and calculate ONE f1 score # MICRO - calculate f1 scores for each class and take their weighted sum def f1_score(precision, recall): f = 0 if precision + recall == 0 \ else 2 * precision * recall / (precision + recall) return f def main(k, confusion_matrix): num_samples = [sum(confusion_matrix[idx]) for idx in range(k)] weights = [s / sum(num_samples) for s in num_samples] precisions = [] recalls = [] for cls_idx in range(k): tp = confusion_matrix[cls_idx][cls_idx] fp = sum([confusion_matrix[idx][cls_idx] for idx in range(k)]) - tp fn = sum([confusion_matrix[cls_idx][idx] for idx in range(k)]) - tp precision = 0 if tp + fp == 0 else tp / (tp + fp) recall = 0 if tp + fn == 0 else tp / (tp + fn) precisions.append(precision) recalls.append(recall) weighted_precision = sum([ weights[idx] * precisions[idx] for idx in range(k) ]) weighted_recall = sum([ weights[idx] * recalls[idx] for idx in range(k) ]) macro_f1 = f1_score(weighted_precision, weighted_recall) f1_scores = [f1_score(precisions[idx], recalls[idx]) for idx in range(k)] micro_f1 = sum([ weights[idx] * f1_scores[idx] for idx in range(k) ]) print(macro_f1) print(micro_f1) if __name__ == '__main__': k = int(input()) confusion_matrix = [] for _ in range(k): values = list(map(int, input().split())) confusion_matrix.append(values) main(k, confusion_matrix)
def f1_score(precision, recall): f = 0 if precision + recall == 0 else 2 * precision * recall / (precision + recall) return f def main(k, confusion_matrix): num_samples = [sum(confusion_matrix[idx]) for idx in range(k)] weights = [s / sum(num_samples) for s in num_samples] precisions = [] recalls = [] for cls_idx in range(k): tp = confusion_matrix[cls_idx][cls_idx] fp = sum([confusion_matrix[idx][cls_idx] for idx in range(k)]) - tp fn = sum([confusion_matrix[cls_idx][idx] for idx in range(k)]) - tp precision = 0 if tp + fp == 0 else tp / (tp + fp) recall = 0 if tp + fn == 0 else tp / (tp + fn) precisions.append(precision) recalls.append(recall) weighted_precision = sum([weights[idx] * precisions[idx] for idx in range(k)]) weighted_recall = sum([weights[idx] * recalls[idx] for idx in range(k)]) macro_f1 = f1_score(weighted_precision, weighted_recall) f1_scores = [f1_score(precisions[idx], recalls[idx]) for idx in range(k)] micro_f1 = sum([weights[idx] * f1_scores[idx] for idx in range(k)]) print(macro_f1) print(micro_f1) if __name__ == '__main__': k = int(input()) confusion_matrix = [] for _ in range(k): values = list(map(int, input().split())) confusion_matrix.append(values) main(k, confusion_matrix)
""" pyPasswordValidator. Password validator """ __version__ = "0.1.3.1" __author__ = 'Jon Duarte' __credits__ = 'iHeart Media'
""" pyPasswordValidator. Password validator """ __version__ = '0.1.3.1' __author__ = 'Jon Duarte' __credits__ = 'iHeart Media'
name = "harry" print(name[0]) # List names = ["Harry", "Ron", "Hermione"] print(names[0]) # Tuples coordinateX = 10.0 coordinateY = 20.0 coordinate = (10.0,20.0) print(coordinate)
name = 'harry' print(name[0]) names = ['Harry', 'Ron', 'Hermione'] print(names[0]) coordinate_x = 10.0 coordinate_y = 20.0 coordinate = (10.0, 20.0) print(coordinate)
#!/usr/bin/env python print (' ') nome = input('Digite seu nome: ') #Mensagem print (' ') print (f'Seja bem-vindo Sr(a) {nome}, Obrigado por vir!') print (' ')
print(' ') nome = input('Digite seu nome: ') print(' ') print(f'Seja bem-vindo Sr(a) {nome}, Obrigado por vir!') print(' ')
#latin square num=int(input("Enter the number of rows:=")) for i in range(1,num+1): r=i #set the first roew element for j in range(1,num+1): print(r,end='\t') if r==num: r=1 else: r=r+1 print()
num = int(input('Enter the number of rows:=')) for i in range(1, num + 1): r = i for j in range(1, num + 1): print(r, end='\t') if r == num: r = 1 else: r = r + 1 print()
if (isWindVpDefined == 1): evapoTranspiration = evapoTranspirationPenman else: evapoTranspiration = evapoTranspirationPriestlyTaylor
if isWindVpDefined == 1: evapo_transpiration = evapoTranspirationPenman else: evapo_transpiration = evapoTranspirationPriestlyTaylor
#!/usr/bin/env python class ShapeGrid(object): """ Generic shape grid interface. Should be subclassed by specific shapes. """ def __init__(self): pass def create_grid(self, layer, extent, num_across=10): raise NotImplementedError('Provided by each subclass of ShapeGrid.')
class Shapegrid(object): """ Generic shape grid interface. Should be subclassed by specific shapes. """ def __init__(self): pass def create_grid(self, layer, extent, num_across=10): raise not_implemented_error('Provided by each subclass of ShapeGrid.')
# -*- coding: utf-8 -*- """ Created on Sun Jan 10 22:57:00 2021 @author: Dragneel """ #%% Tree structure ''' The following Family Tree will be used P1 -- / \ --- \ / \ P11 P12 + P13 --- --------- / | \ / \ / | \ / \ P20 + P21 P22 P23 P24 P25 + P26 --------- --- --- --- --------- \ | / | / | \ \ | / | / | \ P31 P32 P33 P34 P35 P36 P37 ''' #%% Relation Variables parentList = [('child', 'P11', 'P1'), ('child', 'P12', 'P1'), ('child', 'P21', 'P11'), ('child', 'P22', 'P11'), ('child', 'P23', 'P11'), ('child', 'P24', 'P12'), ('child', 'P25', 'P12'), ('child', 'P24', 'P13'), ('child', 'P25', 'P13'), ('child', 'P31', 'P20'), ('child', 'P31', 'P21'), ('child', 'P32', 'P22'), ('child', 'P33', 'P24'), ('child', 'P34', 'P24'), ('child', 'P35', 'P25'), ('child', 'P36', 'P25'), ('child', 'P37', 'P25'), ('child', 'P35', 'P26'), ('child', 'P36', 'P26'), ('child', 'P37', 'P26')] maleList = [ 'P1', 'P11', 'P13', 'P20', 'P25', 'P31', 'P32', 'P33', 'P34'] femaleList = [ 'P12', 'P21', 'P22', 'P23', 'P24', 'P26', 'P35', 'P36', 'P37'] #%% Functions for work def brother(X): i = 0 while(i < len(parentList)): if parentList[i][1] == X: for j in range(len(parentList)): if parentList[i][2] == parentList[j][2] and parentList[i][1] != parentList[j][1] and parentList[j][1] in maleList: print(parentList[j][2], end=' ') i += 1 def sister(X): i = 0 while(i < len(parentList)): if parentList[i][1] == X: for j in range(len(parentList)): if parentList[i][2] == parentList[j][2] and parentList[i][1] != parentList[j][1] and parentList[j][1] in femaleList: print(parentList[j][2], end=' ') i += 1 def uncle(X): i = 0 while(i < len(parentList)): if parentList[i][1] == X: for j in range(len(parentList)): if parentList[j][1] == parentList[i][2]: for k in range(len(parentList)): if parentList[k][2] == parentList[j][2] and parentList[k][1] != parentList[j][1] and parentList[k][1] in maleList: print(parentList[k][1]) i += 1 def aunt(X): i = 0 while(i < len(parentList)): if parentList[i][1] == X: for j in range(len(parentList)): if parentList[j][1] == parentList[i][2]: for k in range(len(parentList)): if parentList[k][2] == parentList[j][2] and parentList[k][1] != parentList[j][1] and parentList[k][1] in femaleList: print(parentList[k][1]) i += 1 #%% Exercise Code X = str(input('Name: ')) Y = str(input('Relation: ')) print(Y, end=' ') if Y == 'Brother': brother(X) elif Y == 'Sister': sister(X) elif Y == 'Uncle': uncle(X) elif Y == 'Aunt': aunt(X) else: print('Relation is not defined')
""" Created on Sun Jan 10 22:57:00 2021 @author: Dragneel """ '\n The following Family Tree will be used\n P1\n --\n / --- / P11 P12 + P13\n --- ---------\n / | \\ / / | \\ / P20 + P21 P22 P23 P24 P25 + P26\n --------- --- --- --- ---------\n \\ | / | / | \\ | / | / | P31 P32 P33 P34 P35 P36 P37\n' parent_list = [('child', 'P11', 'P1'), ('child', 'P12', 'P1'), ('child', 'P21', 'P11'), ('child', 'P22', 'P11'), ('child', 'P23', 'P11'), ('child', 'P24', 'P12'), ('child', 'P25', 'P12'), ('child', 'P24', 'P13'), ('child', 'P25', 'P13'), ('child', 'P31', 'P20'), ('child', 'P31', 'P21'), ('child', 'P32', 'P22'), ('child', 'P33', 'P24'), ('child', 'P34', 'P24'), ('child', 'P35', 'P25'), ('child', 'P36', 'P25'), ('child', 'P37', 'P25'), ('child', 'P35', 'P26'), ('child', 'P36', 'P26'), ('child', 'P37', 'P26')] male_list = ['P1', 'P11', 'P13', 'P20', 'P25', 'P31', 'P32', 'P33', 'P34'] female_list = ['P12', 'P21', 'P22', 'P23', 'P24', 'P26', 'P35', 'P36', 'P37'] def brother(X): i = 0 while i < len(parentList): if parentList[i][1] == X: for j in range(len(parentList)): if parentList[i][2] == parentList[j][2] and parentList[i][1] != parentList[j][1] and (parentList[j][1] in maleList): print(parentList[j][2], end=' ') i += 1 def sister(X): i = 0 while i < len(parentList): if parentList[i][1] == X: for j in range(len(parentList)): if parentList[i][2] == parentList[j][2] and parentList[i][1] != parentList[j][1] and (parentList[j][1] in femaleList): print(parentList[j][2], end=' ') i += 1 def uncle(X): i = 0 while i < len(parentList): if parentList[i][1] == X: for j in range(len(parentList)): if parentList[j][1] == parentList[i][2]: for k in range(len(parentList)): if parentList[k][2] == parentList[j][2] and parentList[k][1] != parentList[j][1] and (parentList[k][1] in maleList): print(parentList[k][1]) i += 1 def aunt(X): i = 0 while i < len(parentList): if parentList[i][1] == X: for j in range(len(parentList)): if parentList[j][1] == parentList[i][2]: for k in range(len(parentList)): if parentList[k][2] == parentList[j][2] and parentList[k][1] != parentList[j][1] and (parentList[k][1] in femaleList): print(parentList[k][1]) i += 1 x = str(input('Name: ')) y = str(input('Relation: ')) print(Y, end=' ') if Y == 'Brother': brother(X) elif Y == 'Sister': sister(X) elif Y == 'Uncle': uncle(X) elif Y == 'Aunt': aunt(X) else: print('Relation is not defined')
def add_time(start: str, duration: str, day: str = None) -> str: days = ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday') start_lst = list(map(int, start[:-3].split(':'))) duration_lst = list(map(int, duration.split(':'))) total_min = start_lst[1] + duration_lst[1] extra_hours = total_min // 60 total_hours = start_lst[0] + duration_lst[0] + extra_hours if 'PM' in start: total_hours += 12 ans_minutes = total_min % 60 ans_hours = total_hours % 12 num_of_days = total_hours // 24 ans_minutes = str(ans_minutes).rjust(2, '0') ans_hours = '12' if ans_hours == 0 else str(ans_hours) period = 'AM' if (total_hours % 24) < 12 else 'PM' new_time = f'{ans_hours}:{ans_minutes} {period}' if day is not None: day = day.lower().capitalize() days = days[days.index(day):] + days[:days.index(day)] # from what day to start new_time += f', {days[num_of_days % 7]}' if num_of_days == 1: new_time += ' (next day)' elif num_of_days > 1: new_time += f' ({num_of_days} days later)' return new_time
def add_time(start: str, duration: str, day: str=None) -> str: days = ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday') start_lst = list(map(int, start[:-3].split(':'))) duration_lst = list(map(int, duration.split(':'))) total_min = start_lst[1] + duration_lst[1] extra_hours = total_min // 60 total_hours = start_lst[0] + duration_lst[0] + extra_hours if 'PM' in start: total_hours += 12 ans_minutes = total_min % 60 ans_hours = total_hours % 12 num_of_days = total_hours // 24 ans_minutes = str(ans_minutes).rjust(2, '0') ans_hours = '12' if ans_hours == 0 else str(ans_hours) period = 'AM' if total_hours % 24 < 12 else 'PM' new_time = f'{ans_hours}:{ans_minutes} {period}' if day is not None: day = day.lower().capitalize() days = days[days.index(day):] + days[:days.index(day)] new_time += f', {days[num_of_days % 7]}' if num_of_days == 1: new_time += ' (next day)' elif num_of_days > 1: new_time += f' ({num_of_days} days later)' return new_time
#! /usr/bin/env python3 # Type of variable: Number a, b = 5, 10 print(a, b) a, b = b, a print(a, b) # Type of variable: List myList = [1, 2, 3, 4, 5] print("Initial Array :", myList) myList[0], myList[1] = myList[1], myList[0] print("Swapped Array :", myList)
(a, b) = (5, 10) print(a, b) (a, b) = (b, a) print(a, b) my_list = [1, 2, 3, 4, 5] print('Initial Array :', myList) (myList[0], myList[1]) = (myList[1], myList[0]) print('Swapped Array :', myList)
def up_egcd(m,n): #Assume m>n if n>m: m,n=n,m if m%n==0: return n else: return up_egcd(n,m%n) print(up_egcd(int(input('Number 1\n')),int(input('Number 2\n'))))
def up_egcd(m, n): if n > m: (m, n) = (n, m) if m % n == 0: return n else: return up_egcd(n, m % n) print(up_egcd(int(input('Number 1\n')), int(input('Number 2\n'))))
class AbstractRecurrentNeuralNetworkBuilder(object): """Build a recurrent neural network according to specified the input/output dimensions and number of unrolled steps. """ DEFAULT_VARIABLE_SCOPE = "recurrent_neural_network" def __init__(self, tensors, mixture_density_output, feature_builder=None, variable_scope=None): """ """ self.tensors = tensors self.mixture_density_output = mixture_density_output self.feature_builder = feature_builder self.variable_scope = AbstractRecurrentNeuralNetworkBuilder.DEFAULT_VARIABLE_SCOPE \ if variable_scope is None \ else variable_scope def get_sequence_tensors(self): """Get sequence unrolled sequence unrolled tensors. """ raise NotImplementedError def build_lstm(self): """Build lstm model by unrolling the lstm layer(s). Output the unrolled tensors that could be used for either generating sequences or training. """ raise NotImplementedError def _get_current_samples(self, current_output, current_time): """Sample activity types, duration, travel time, next activity start time, and etc from current lstm output. Args: current_output(tf.tensor): the transformed output from rnn. Should have shape [batch_size, output_dimension] current_time(tf.tensor): the current time of each element in the batch. Should have shape [batch_size, 1] """ raise NotImplementedError def _get_next_input(self, current_time, activity_type, context_variables): """Get next lstm input features from sampled activity of previous step. """ raise NotImplementedError def _save_model(self, file_path): """Save model weights to a file with location of file_path. Args: file_path(str): the file path string. """ raise NotImplementedError def _load_model(self): """Load model weights to a file with location of file_path. Args: file_path(str): the file path string. """ raise NotImplementedError
class Abstractrecurrentneuralnetworkbuilder(object): """Build a recurrent neural network according to specified the input/output dimensions and number of unrolled steps. """ default_variable_scope = 'recurrent_neural_network' def __init__(self, tensors, mixture_density_output, feature_builder=None, variable_scope=None): """ """ self.tensors = tensors self.mixture_density_output = mixture_density_output self.feature_builder = feature_builder self.variable_scope = AbstractRecurrentNeuralNetworkBuilder.DEFAULT_VARIABLE_SCOPE if variable_scope is None else variable_scope def get_sequence_tensors(self): """Get sequence unrolled sequence unrolled tensors. """ raise NotImplementedError def build_lstm(self): """Build lstm model by unrolling the lstm layer(s). Output the unrolled tensors that could be used for either generating sequences or training. """ raise NotImplementedError def _get_current_samples(self, current_output, current_time): """Sample activity types, duration, travel time, next activity start time, and etc from current lstm output. Args: current_output(tf.tensor): the transformed output from rnn. Should have shape [batch_size, output_dimension] current_time(tf.tensor): the current time of each element in the batch. Should have shape [batch_size, 1] """ raise NotImplementedError def _get_next_input(self, current_time, activity_type, context_variables): """Get next lstm input features from sampled activity of previous step. """ raise NotImplementedError def _save_model(self, file_path): """Save model weights to a file with location of file_path. Args: file_path(str): the file path string. """ raise NotImplementedError def _load_model(self): """Load model weights to a file with location of file_path. Args: file_path(str): the file path string. """ raise NotImplementedError
inp = open('input.txt').read().split(", ") # Reading file coord = (0, 0) # Setting original coordinates p_dir = 0 # Setting original direction (north) seen = set() for instr in inp: dir = instr[0] step = int(instr[1:]) if dir == "R": p_dir = p_dir + 1 if p_dir == 4: p_dir = 0 elif dir == "L": if p_dir == 0: p_dir = 4 p_dir = p_dir - 1 for step in range(step): if p_dir == 0: coord = (coord[0], coord[1] + 1) elif p_dir == 1: coord = (coord[0] + 1, coord[1]) elif p_dir == 2: coord = (coord[0], coord[1] - 1) elif p_dir == 3: coord = (coord[0] - 1, coord[1]) if coord in seen: dist = abs(coord[0]) + abs(coord[1]) print(dist) exit() seen.add(coord)
inp = open('input.txt').read().split(', ') coord = (0, 0) p_dir = 0 seen = set() for instr in inp: dir = instr[0] step = int(instr[1:]) if dir == 'R': p_dir = p_dir + 1 if p_dir == 4: p_dir = 0 elif dir == 'L': if p_dir == 0: p_dir = 4 p_dir = p_dir - 1 for step in range(step): if p_dir == 0: coord = (coord[0], coord[1] + 1) elif p_dir == 1: coord = (coord[0] + 1, coord[1]) elif p_dir == 2: coord = (coord[0], coord[1] - 1) elif p_dir == 3: coord = (coord[0] - 1, coord[1]) if coord in seen: dist = abs(coord[0]) + abs(coord[1]) print(dist) exit() seen.add(coord)
# Problem : https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/submissions/ # Ref : https://youtu.be/wuzTpONbd-0 # 2 transactions only class Solution(object): def maxProfit(self, prices): """ :type prices: List[int] :rtype: int """ n = len(prices) # Calc dp - left -> Max profit so far - Buy before and sell today / before # Similar to one transaction buy sell stock problem max_profit_till_today = 0 min_so_far = prices[0] dp_left = [0]*n for i in range(1 , n): # Calculate best buying day -> min before the current selling day min_so_far = min(min_so_far , prices[i]) # Calc profit for current day max_profit_till_today = prices[i] - min_so_far # Update the global max profit possible uptil today dp_left[i] = max(dp_left[i-1] , max_profit_till_today ) print(dp_left) # Cal dp - right -> Max profit so far - Buy today/later and sell later max_profit_from_today = 0 max_from_today = prices[n-1] dp_right = [0]*n for i in range(n-2 , -1 , -1 ): # Calculate best selling day -> max from today - current buying day max_from_today = max(max_from_today , prices[i]) # Calc profit for today max_profit_from_today = max_from_today - prices[i] # Update the global profit possible from today dp_right[i] = max(dp_right[i+1] , max_profit_from_today) # Calc max( dp-right + dp-left ) max_profit = 0 for i in range(0 , n): sum_of_2 = dp_right[i] + dp_left[i] max_profit = max(sum_of_2 , max_profit) return max_profit
class Solution(object): def max_profit(self, prices): """ :type prices: List[int] :rtype: int """ n = len(prices) max_profit_till_today = 0 min_so_far = prices[0] dp_left = [0] * n for i in range(1, n): min_so_far = min(min_so_far, prices[i]) max_profit_till_today = prices[i] - min_so_far dp_left[i] = max(dp_left[i - 1], max_profit_till_today) print(dp_left) max_profit_from_today = 0 max_from_today = prices[n - 1] dp_right = [0] * n for i in range(n - 2, -1, -1): max_from_today = max(max_from_today, prices[i]) max_profit_from_today = max_from_today - prices[i] dp_right[i] = max(dp_right[i + 1], max_profit_from_today) max_profit = 0 for i in range(0, n): sum_of_2 = dp_right[i] + dp_left[i] max_profit = max(sum_of_2, max_profit) return max_profit
def test_it(binbb, repos_cfg): """Test just the first one""" expected_words = ("Fields Values Branch Name Author" " TimeStamp Commit ID Message").split() for account_name, rep_cfg in repos_cfg.items(): for repo_name in rep_cfg.keys(): bbcmd = ["repo", "branch", "-a", account_name, "-r", repo_name] # Expecting the call to succeed res = binbb.sysexec(*bbcmd) # Make simple test if the output is as expected for word in expected_words: assert word in res lines = res.strip().splitlines() assert len(lines) >= 8 # Stop testing with first repository return
def test_it(binbb, repos_cfg): """Test just the first one""" expected_words = 'Fields Values Branch Name Author TimeStamp Commit ID Message'.split() for (account_name, rep_cfg) in repos_cfg.items(): for repo_name in rep_cfg.keys(): bbcmd = ['repo', 'branch', '-a', account_name, '-r', repo_name] res = binbb.sysexec(*bbcmd) for word in expected_words: assert word in res lines = res.strip().splitlines() assert len(lines) >= 8 return
"""Rotate a matrix by 90 degrees.""" def rotate_in_place(matrix): """ Modify and return the original matrix. rotated 90 degrees clockwise in place. """ try: n = len(matrix) m = len(matrix[0]) for i in range(n//2): for j in range(i, m-1-i): ii, jj = i, j hold = matrix[ii][jj] for _ in range(3): matrix[ii][jj] = matrix[n-1-jj][ii] ii, jj = n-1-jj, ii matrix[ii][jj] = hold except IndexError: return matrix return matrix
"""Rotate a matrix by 90 degrees.""" def rotate_in_place(matrix): """ Modify and return the original matrix. rotated 90 degrees clockwise in place. """ try: n = len(matrix) m = len(matrix[0]) for i in range(n // 2): for j in range(i, m - 1 - i): (ii, jj) = (i, j) hold = matrix[ii][jj] for _ in range(3): matrix[ii][jj] = matrix[n - 1 - jj][ii] (ii, jj) = (n - 1 - jj, ii) matrix[ii][jj] = hold except IndexError: return matrix return matrix
class Human(object): def __init__(self, world=None, age=20): self.maxAge = 50 self.age = age self.alive = True self.world = world def update(self): self.age += 1 if self.age > self.maxAge: self.alive = False def get_age(self): return self.age def is_alive(self): return self.alive
class Human(object): def __init__(self, world=None, age=20): self.maxAge = 50 self.age = age self.alive = True self.world = world def update(self): self.age += 1 if self.age > self.maxAge: self.alive = False def get_age(self): return self.age def is_alive(self): return self.alive